Part Number Hot Search : 
UFT31 MSCD100 AN1780 9EC10 TZA3044 5KE200A 2SA1204 74HCT109
Product Description
Full Text Search
 

To Download HD6437034 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  regarding the change of names mentioned in the document, such as hitachi electric and hitachi xx, to renesas technology corp. the semiconductor operations of mitsubishi electric and hitachi were transferred to renesas technology corporation on april 1st 2003. these operations include microcomputer, logic, analog and discrete devices, and memory chips other than drams (flash memory, srams etc.) accordingly, although hitachi, hitachi, ltd., hitachi semiconductors, and other hitachi brand names are mentioned in the document, these names have in fact all been changed to renesas technology corp. thank you for your understanding. except for our corporate trademark, logo and corporate statement, no changes whatsoever have been made to the contents of the document, and these changes do not constitute any alteration to the contents of the document itself. renesas technology home page: http://www.renesas.com renesas technology corp. customer support dept. april 1, 2003 to all our customers
cautions keep safety first in your circuit designs! 1. renesas technology corporation puts the maximum effort into making semiconductor products better and more reliable, but there is always the possibility that trouble may occur with them. trouble with semiconductors may lead to personal injury, fire or property damage. remember to give due consideration to safety when making your circuit designs, with appropriate measures such as (i) placement of substitutive, auxiliary circuits, (ii) use of nonflammable material or (iii) prevention against any malfunction or mishap. notes regarding these materials 1. these materials are intended as a reference to assist our customers in the selection of the renesas technology corporation product best suited to the customer's application; they do not convey any license under any intellectual property rights, or an y other rights, belonging to renesas technology corporation or a third party. 2. renesas technology corporation assumes no responsibility for any damage, or infringement of any third-party's rights, originating in the use of any product data, diagrams, charts, programs, algorithms, or circuit application examples contained i n these materials. 3. all information contained in these materials, including product data, diagrams, charts, programs and algorithms represents information on products at the time of publication of these materials, and are subject to change by renesas technology corporation without notice due to product improvements or other reasons. it is therefore recommended that customers contact renesas technology corporation or an authorized renesas technology corporation product distributor for the latest product information before purchasing a product listed herein. the information described here may contain technical inaccuracies or typographical errors. renesas technology corporation assumes no responsibility for any damage, liability, or other loss rising from these inaccuracies or errors. please also pay attention to information published by renesas technology corporation by various means, including the renesas technology corporation semiconductor home page (http://www.renesas.com). 4. when using any or all of the information contained in these materials, including product data, diagrams, charts, programs, an d algorithms, please be sure to evaluate all information as a total system before making a final decision on the applicability of the information and products. renesas technology corporation assumes no responsibility for any damage, liability or other loss resulting from the information contained herein. 5. renesas technology corporation semiconductors are not designed or manufactured for use in a device or system that is used under circumstances in which human life is potentially at stake. please contact renesas technology corporation or an authorized renesas technology corporation product distributor when considering the use of a product contained herein for any specific purposes, such as apparatus or systems for transportation, vehicular, medical, aerospace, nuclear, or undersea repeater use. 6. the prior written approval of renesas technology corporation is necessary to reprint or reproduce in whole or in part these materials. 7. if these products or technologies are subject to the japanese export control restrictions, they must be exported under a lice nse from the japanese government and cannot be imported into a country other than the approved destination. any diversion or reexport contrary to the export control laws and regulations of japan and/or the country of destination is prohibited. 8. please contact renesas technology corporation for further details on these materials or the products contained therein.
superh risc engine sh7032 and sh7034 hd6417032, hd6477034, HD6437034, hd6417034 HD6437034b, hd6417034b hardware manual ade-602-062e rev. 6.0 9/18/03 hitachi, ltd.
cautions 1. hitachi neither warrants nor grants licenses of any rights of hitachi? or any third party? patent, copyright, trademark, or other intellectual property rights for information contained in this document. hitachi bears no responsibility for problems that may arise with third party? rights, including intellectual property rights, in connection with use of the information contained in this document. 2. products and product specifications may be subject to change without notice. confirm that you have received the latest product standards or specifications before final design, purchase or use. 3. hitachi makes every attempt to ensure that its products are of high quality and reliability. however, contact hitachi? sales office before using the product in an application that demands especially high quality and reliability or where its failure or malfunction may directly threaten human life or cause risk of bodily injury, such as aerospace, aeronautics, nuclear power, combustion control, transportation, traffic, safety equipment or medical equipment for life support. 4. design your application so that the product is used within the ranges guaranteed by hitachi particularly for maximum rating, operating supply voltage range, heat radiation characteristics, installation conditions and other characteristics. hitachi bears no responsibility for failure or damage when used beyond the guaranteed ranges. even within the guaranteed ranges, consider normally foreseeable failure rates or failure modes in semiconductor devices and employ systemic measures such as fail-safes, so that the equipment incorporating hitachi product does not cause bodily injury, fire or other consequential damage due to operation of the hitachi product. 5. this product is not designed to be radiation resistant. 6. no one is permitted to reproduce or duplicate, in any form, the whole or part of this document without written approval from hitachi. 7. contact hitachi? sales office for any questions regarding this document or hitachi semiconductor products.
preface the sh7032 and sh7034 are microprocessors that integrate peripheral functions necessary for system configuration with a 32-bit internal architecture sh1-dsp cpu as its core. the sh7032 and sh7034's on-chip peripheral functions include an interrupt controller, timers, serial communication interfaces, a user break controller (ubc), a bus state controller (bsc), a direct memory access controller (dmac), and i/o ports, making it ideal for use as a microcomputer in electronic devices that require high speed together with low power consumption. intended readership: this manual is intended for users undertaking the design of an application system using the sh7032 and sh7034. readers using this manual require a basic knowledge of electrical circuits, logic circuits, and microcomputers. purpose: the purpose of this manual is to give users an understanding of the hardware functions and electrical characteristics of the sh7032 and sh7034. details of execution instructions can be found in the sh-1, sh-2, sh-dsp programming manual, which should be read in conjunction with the present manual. using this manual: ? for an overall understanding of the sh7032 and sh7034's functions follow the table of contents. this manual is broadly divided into sections on the cpu, system control functions, peripheral functions, and electrical characteristics. ? for a detailed understanding of cpu functions refer to the separate publication sh-1, sh-2, sh-dsp programming manual. note on bit notation: bits are shown in high-to-low order from left to right. related material: the latest information is available at our web site. please make sure that you have the most up-to-date information available. http://www.hitachisemiconductor.com/
user's manuals on the sh7032 and sh7034: manual title ade no. sh7032 and sh7034 hardware manual this manual sh-1, sh-2, sh-dsp programming manual ade-602-085 users manuals for development tools: manual title ade no. c/c++ complier, assembler, optimized linkage editor user's manual ade-702-304 simulator debugger users manual ade-702-266 hitachi embedded workshop users manual ade-702-275 application note: manual title ade no. c/c++ complier ade-502-046
organization of this manual table 1 describes how this manual is organized. figure 1 shows the relationships between the sections within this manual. table 1 manual organization category section title abbrevi- ation contents overview 1. overview features, internal block diagram, pin layout, pin functions cpu 2. cpu cpu register configuration, data structure. instruction features, instruction types, instruction lists operating modes 3. operating modes mcu mode, prom mode internal modules 4. exception handling resets, address errors, interrupts, trap instructions, illegal instructions 5. interrupt controller intc nmi interrupts, user break interrupts, irq interrupts, on-chip module interrupts 6. user break controller ubc break address and break bus cycle selection clock 7. clock pulse generator cpg crystal pulse generator, duty correction circuit buses 8. bus state controller bsc division of memory space, dram interface, refresh, wait state control, parity control 9. direct memory access controller dmac auto request, external request, on-chip peripheral module request, cycle steal mode, burst mode timers 10. 16-bit integrated timer pulse unit itu waveform output mode, input capture function, counter clear function, buffer operation, pwm mode, complementary pwm mode, reset synchronized mode, synchronized operation, phase counting mode, compare match output mode 11. programmable timing pattern controller tpc compare match output triggers, non- overlap operation 12. watchdog timer wdt watchdog timer mode, interval timer mode data processing 13. serial communication interface sci asynchronous mode, synchronous mode, multiprocessor communication function 14. a/d converter a/d single mode, scan mode, activation by external trigger
table 1 manual organization (cont) category section title abbrevi- ation contents pins 15. pin function controller pfc pin function selection 16. parallel i/o ports i/o i/o ports memory 17. rom rom prom mode, high-speed programming system 18. ram ram on-chip ram power-down state 19. power-down state sleep mode, standby mode electrical char act er i s t i c s 20. electrical characteristics absolute maximum ratings, ac characteristics, dc characteristics, operation timing
4. exception handling 5. interrupt controller (intc) 6. user break controller (ubc) on-chip modules 7. clock pulse generator (cpg) 8. bus state controller (bsc) 9. direct memory access controller (dmac) buses 10. 16-bit integrated timer pulse unit (itu) timers 13. serial communication interface (sci) 14. a/d converter data processing 15. pin function controller (pfc) 16. parallel i/o ports pins 17. rom 18. ram memory 19. power-down state 20. electrical characteristics 1. overview 2. cpu 3. operating modes 11. programmable timing pattern controller (tpc) 12. watchdog timer (wdt) figure 1 manual organization
addresses of on-chip peripheral module registers the on-chip peripheral module registers are located in the on-chip peripheral module space (area 5: h'5000000?'5ffffff), but since the actual register space is only 512 bytes, address bits a23?9 are ignored. 32k shadow areas in 512 byte units that contain exactly the same contents as the actual registers are thus provided in the on-chip peripheral module space. in this manual, register addresses are specified as though the on-chip peripheral module registers were in the 512 bytes h'5fffe00?'5ffffff. only the values of the a27?24 and a8?0 bits are valid; the a23?9 bits are ignored. when area h'5000000?'50001ff is accessed, for example, the result will be the same as when area h'5fffe00?'5ffffff is accessed. for more details, see section 8.3.5, area descriptions: area 5.
list of items revised or added for this version section page description edition 1.1 superh microcomputer features table 1.2 product lineup 6, 7 sh7034, sh7032: 2 to 16.6 mhz device deleted. product number on-chip rom operating voltage operating frequency temperature range model marking model no. * 2 package sh7032 romless 5.0 v 2 to 20 mhz -20 to +75 c hd6417032f20 hd6417032f20 112-pin plastic -40 to +85 c hd6417032fi20 hd6417032fi20 qfp (fp-112) 3.3 v 2 to 12.5 mhz -20 to +75 c hd6417032vf12 hd6417032vf12 -40 to +85 c hd6417032vfi12 hd6417032vfi12 5.0 v 2 to 20 mhz -20 to +75 c hd6417032x20 hd6417032te20 120-pin plastic -40 to +85 c hd6417032xi20 hd6417032tei20 tqfp (tfp-120) 3.3 v 2 to 12.5 mhz -20 to +75 c hd6417032vx12 hd6417032vte12 -40 to +85 c hd6417032vxi12 hd6417032vtei12 sh7034 prom 5.0 v 2 to 20 mhz -20 to +75 c hd6477034f20 hd6477034f20 112-pin plastic -40 to +85 c hd6477034fi20 hd6477034fi20 qfp (fp-112) 3.3 v 2 to12.5 mhz -20 to +75 c hd6 4 7 70 3 4 v f1 2 hd6 4 7 70 3 4 v f1 2 -40 to +85 c hd6 4 7 70 3 4 v fi 1 2 hd6 4 7 70 3 4 v fi 1 2 5.0 v 2 to 20 mhz -20 to +75 c hd6477034x20 hd6 4 7 70 3 4 te 2 0 120-pin plastic -40 to +85 c hd6477034xi20 hd6 4 7 70 3 4 te i 2 0 tqfp (tfp-120) 3.3 v 2 to 12.5 mhz -20 to +75 c hd6 4 7 70 3 4 v x 1 2 hd6 4 7 70 3 4 v te 1 2 -40 to +85 c hd6 4 7 70 3 4 v x i 1 2 hd6 4 7 70 3 4 v te i 1 2 mask 5.0 v 2 to 20 mhz -20 to +75 c HD6437034af20 HD6437034af20 112-pin plastic rom -40 to +85 c HD6437034afi20 HD6437034afi20 qfp (fp-112) 3.3 v 2 to 12.5 mhz -20 to +75 c HD6437034avf12 HD6437034af12 -40 to +85 c HD6437034avfi12 HD6437034afi12 5.0 v 2 to 20 mhz -20 to +75 c HD6437034ax20 HD6437034ate20 120-pin plastic -40 to +85 c HD6437034axi20 HD6437034atei20 tqfp (tfp-120) 3.3 v 2 to 12.5 mhz -20 to +75 c hd6437 0 3 4 a vx 1 2 HD6437034ate12 -40 to +85 c HD6437034avxi12 HD6437034atei12 romless 5.0 v 2 to 20 mhz -20 to +75 c hd6417034f20 hd6417034f20 112-pin plastic -40 to +85 c hd6417034fi20 hd6417034fi20 qfp (fp-112) 3.3 v 2 to 12.5 mhz -20 to +75 c hd6417034vf12 hd6417034vf12 -40 to +85 c hd6417034vfi12 hd6417034vfi12 5.0 v 2 to 20 mhz -20 to +75 c hd6417034x20 hd6417034te20 120-pin plastic -40 to +85 c hd6417034xi20 hd6417034tei20 tqfp (tfp-120) 3.3 v 2 to 12.5 mhz -20 to +75 c hd6417034vx12 hd6417034vte12 -40 to +85 c hd6417034vxi12 hd6417034vtei12 product number on-chip rom operating voltage operating frequency temperature range model marking model no. * 2 package sh7034b * 1 mask 3.3 v 4 to 12.5 mhz -20 to +75 c HD6437034bvf12 6437034b( *** )f 112-pin plastic rom -40 to +85 c HD6437034bvfw12 6437034b( *** )fw qfp (fp-112) -20 to +75 c HD6437034bvx12 6437034b (*** )x 120-pin plastic -40 to +85 c HD6437034bvxw12 6437034b( *** )xw tqfp (tfp-120) romless 3.3 v 4 to 20 mhz -20 to +75 c hd6417034bvf20 hd6417034bvf20 112-pin plastic -40 to +85 c hd6417034bvfw20 hd6417034bvfw20 qfp (fp-112) -20 to +75 c hd6417034bvx20 6417034bvte20 120-pin plastic -40 to +85 c hd6417034bvxw20 6417034bvtew20 tqfp (tfp-120) notes: * 1 the electrical characteristics of the sh7034b mask rom version and sh7034 prom version are different. * 2 for mask rom versions, ( *** ) is the rom code. 6 1.3.2 pin functions table 1.3 pin functions 12 note amended * 2 can be used in the sh7034 prom version. 6
section page description edition 2.1.2 control registers figure 2.2 control registers 18 description amended bits i3 i0: interrupt mask bits. 6 2.1.4 initial values of registers table 2.1 initial values of registers 19 description amended sr bits i3 i0 are 1111(h'f), reserved bits are 0, and other bits are undefined 6 3.1 types of operating modes and their selection table 3.1 operating mode selection 49 note amended * 2 only modes 0 and 1 are available in the sh7032 and sh7034 romless version. 6 8.11.3 maximum number of states from breq input to bus release figure 8.47 bus release procedure 174 description amended t bacd2 t brqs t bacd1 6 9.1.4 register configuration table 9.2 dmac registers 179 * 4 added * 4 only the values of bits a27 a24 and a8 a0 are valid; bits a23 a9 are ignored. for details on the register addresses, see section 8.3.5, area descriptions. 6 9.3.4 dma transfer types 200 description amended line 3 ??? destination or source must be the sci or a/d converter (table 9.4). ??? 6 10.1.4 register configuration table 10.3 register configuration 230 * 2 description amended * 2 only 0 can be written to clear flags. 6 10.4.5 reset- synchronized pwm mode procedure for selecting reset- synchronized pwm mode (figure 10.31): 268 description amended 4. set bits cmd1 and cmd0 in tfcr to select reset-synchronized pwm mode. tioca3, tiocb3, tioca4, tiocb4, tocxa4, and tocxb4 become pwm output pins. 6
section page description edition 10.4.6 complementary pwm mode procedure for selecting complementary pwm mode (figure 10.33): 271 description amended 3. set bits cmd1 and cmd0 in tmdb to select complementary pwm mode. tioca3, tiocb3, tioca4, tiocb4, tocxa4, and tocxb4 become pwm pins. 6 10.6.15 itu operating modes table 10.18 itu operating modes (channel 0) 301 table amended register setting tsnc tmdr tfcr tocr tior0 tcr0 operating mode sync mdf fdir pwm comp pwm reset sync pwm buffer output level select ioa iob clear select clock select synch- ronized preset sync0 = 1 ? ? pwm pwm0 = 1 ? output compare a function pwm0 = 0 ioa2 = 0, others: don t care ?? 6 table 10.19 itu operating modes (channel 1) 302 table amended register setting tsnc tmdr tfcr tocr tior1 tcr1 operating mode sync mdf fdir pwm comp pwm reset sync pwm buffer output level select ioa iob clear select clock select synch- ronized preset sync1 = 1 ? ? pwm pwm1 = 1 ? output compare a function pwm1 = 0 ioa2 = 0, others: don t care ?? 6 table 10.20 itu operating modes (channel 2) 303 table amended register setting tsnc tmdr tfcr tocr tior2 tcr2 operating mode sync mdf fdir pwm comp pwm reset sync pwm buffer output level select ioa iob clear select clock select synch- ronized preset sync2 = 1 ? ? pwm pwm2 = 1 ? output compare a function pwm2 = 0 ioa2 = 0, others: don t care ?? 6 12.1.4 register configuration table 12.2 wdt registers 337 * 4 added initial address * 4 name abbreviation r/w value write * 1 read * 2 timer control/status register tcsr r/(w) * 3 h'18 h'5ffffb8 h'5ffffb8 timer counter tcnt r/w h'00 h'5ffffb9 reset control/status register rstcsr r/(w) * 3 h'1f h'5ffffba h'5ffffbb notes: * 1 write by word transfer. a byte or longword write cannot be used. * 2 read by byte transfer. the correct value cannot be obtained by a word or longword read. * 3 only 0 can be written in bit 7, to clear the flag. * 4 only the values of bits a27 a24 and a8 a0 are valid; bits a23 a9 are ignored. for details on the register addresses, see section 8.3.5, area descriptions 6
section page description edition 12.2.2 timer control/status register (tcsr) 338 note added note: * only 0 can be written, to clear the flag. 6 13.2.6 serial control register 359 initial value added internal clock, sck pin used for input pin (input signal is ignored) or output pin (output level is undefined) * 2 (initial value) internal clock, sck pin used for serial clock output * 2 (initial value) 6 13.2.8 bit rate register (brr) table 13.3 bit rates and brr settings in asynchronous mode 367 note added note: settings with an error of 1% or less are recommended. 6 table 13.4 bit rates and brr settings in synchronous mode 368 note deleted 6 15.2 register configuration table 15.2 pin function controller registers 427 note added name abbreviation r/w initial value address * access size port a i/o register paior r/w h'0000 h'5ffffc4 8, 16, 32 port a control register 1 pacr1 r/w h'3302 h'5ffffc8 8, 16, 32 port a control register 2 pacr2 r/w h'ff95 h'5ffffca 8, 16, 32 port b i/o register pbior r/w h'0000 h'5ffffc6 8, 16, 32 port b control register 1 pbcr1 r/w h'0000 h'5ffffcc 8, 16, 32 port b control register 2 pbcr2 r/w h'0000 h'5ffffce 8, 16, 32 column address strobe pin control register cascr r/w h'5fff h'5ffffee 8, 16, 32 note: * only the values of bits a27 a24 and a8 a0 are valid; bits a23 a9 are ignored. for details on the register addresses, see section 8.3.5, area descriptions. 6 16.2.1 register configuration table 16.1 port a register 442 note added name abbreviation r/w initial value address * access size port a data register padr r/w h'0000 h'5ffffc0 8, 16, 32 note: * only the values of bits a27 a24 and a8 a0 are valid; bits a23 a9 are ignored. for details on the register addresses, see section 8.3.5, area descriptions. 6 16.3.1 register configuration table 16.3 port b register 443 note added name abbreviation r/w initial value address * access size port b data register pbdr r/w h'0000 h'5ffffc2 8, 16, 32 note: * only the values of bits a27 a24 and a8 a0 are valid; bits a23 a9 are ignored. for details on the register addresses, see section 8.3.5, area descriptions. 6 16.4.1 register configuration table 16.5 port c register 445 note added name abbreviation r/w initial value address * access size note: * only the values of bits a27 a24 and a8 a0 are valid; bits a23 a9 are ignored. for details on the register addresses, see section 8.3.5, area descriptions. port c data register pcdr r/w h'5ffffd0 8, 16, 32 6
section page description edition 19.1.2 register table 19.2 standby control register (sbycr) 460 note added name abbreviation r/w initial value address * access size standby control register sbycr r/w h'1f h'5ffffbc 8, 16, 32 note: * only the values of bits a27 a24 and a8 a0 are valid; bits a23 a9 are ignored. for details on the register addresses, see section 8.3.5, area descriptions. 6 20.1.2 dc characteristics table 20.2 dc characteristics 467 16.6 mhz deleted 6 table 20. 2 dc characteristics ? table of 16.6 mhz deleted 6 table 20.3 permitted output current values 471 16.6 mhz deleted 6 20.1.3 ac characteristics (1) clock timing table 20.4 clock timing 472 16.6 mhz deleted 6 (2) control signal timing table 20.5 control signal timing 474 16.6 mhz deleted 6 (3) bus timing table 20.6 bus timing (1) 478, 479 description amended read data access time 1 * 6 t acc1 t cyc 30 * 4 ns 20.8, 20.11, 20.12 read data access time 2 * 6 t acc2 t cyc (n+2) 30 * 3 ns 20.9, 20.10, 20.13 20.15 read data access time from cas 2 * 6 t cac2 t cyc (n+1) 25 * 3 ns read data access time from ras 1 * 6 t rac1 t cyc 1.5 20 ns 20.11, 20.12 read data access time from ras 2 * 6 t rac2 t cyc (n+2.5) 20 * 3 ns 20.13 20.15 20.13 20.15 data setup time for cas t ds 0 * 5 ns 20.11, 20.13 cas setup time for ras t csr 10 ns 20.16 20.18 row address hold time t rah 10 ns 20.11, 20.13 6 table 20.7 bus timing (2) ? table deleted 6 table 20.7 bus timing (2) 494 description amended read data access time 1 * 4 t acc1 t cyc 44 ns 20.21, 20.24, 20.25 read data access time 2 * 4 t acc2 t cyc (n+2) 44 * 2 ns 20.22, 20.23, 20.26 20.28 6
section page description edition (4) dmac timing table 20.8 dmac timing 507 16.6 mhz deleted 6 (5) 16-bit integrated timer pulse unit timing table 20.9 16-bit integrated timer pulse unit timing 509 16.6 mhz deleted 6 (6) programmable timing pattern controller and i/o port timing table 20.10 programmable timing pattern controller and i/o port timing 510 16.6 mhz deleted 6 (7) watchdog timer timing table 20.11 watchdog timer timing 511 16.6 mhz deleted 6 (8) serial communication interface timing table 20.12 serial communication interface timing 512 16.6 mhz deleted 6 (9) a/d converter timing table 20.13 a/d converter timing 513 16.6 mhz deleted 6 20.1.4 a/d converter characteristics table 20.14 a/d converter characteristics 516 16.6 mhz deleted 6 20.2 sh7034b 3.3 v 12.5 mhz version and 20 mhz version * 1 electrical characteristics 517 12.5 mhz added 6
section page description edition 20.2.1 absolute maximum ratings table 20.15 absolute maximum ratings 517 notes amended item symbol rating unit power supply voltage v cc 0.3 to +4.6 v input voltage (except port c) v in 0.3 to v cc + 0.3 v input voltage (port c) v in 0.3 to av cc + 0.3 v analog power supply voltage av cc 0.3 to +4.6 v analog reference voltage av ref 0.3 to av cc + 0.3 v analog input voltage v an 0.3 to av cc + 0.3 v operating temperature t opr 20 to +75 * 2 ? c storage temperature t stg 55 to +125 ? c caution: operating the chip in excess of the absolute maximum rating may result in permanent damage. notes: * 1 romless products only for 20 mhz version * 2 regular-specification products; for wide-temperature-range products, topr = 40 to +85 c 6 table 20.16 dc characteristics 518, 519 12.5 mhz added conditions: v cc = 3.3 v 20 to +75 40 to +85 current ordinary i cc 25 ma f = 12.5 mhz consumption operation 35 60 ma f = 20 mhz sleep 20 ma f = 12.5 mhz 30 40 ma f = 20 mhz standby 0.1 5 a ta 50 c 10 a50 c < ta 6 table 20.17 permitted output current values 521 12.5 mhz added 12.5 mhz 20 mhz item symbol min typ max min typ max unit output low-level permissible current (per pin) i ol 10 10 ma output low-level permissible current (total) i ol 80 80 ma output high-level permissible current (per pin) i oh 2.0 2.0 ma output high-level permissible current (total) i oh 25 25 ma caution: to ensure reliability of the chip, do not exceed the output current values given in table 20.18. 6
section page description edition 20.2.3 ac characteristics ( 1 ) clock timing table 20.18 clock timing 522 12.5 mhz added and description amended 12.5 mhz 20 mhz item symbol min max min max unit figures extal input high level pulse width t exh 22 15 ns 20.45 extal input low level pulse width t exl 22 15 ns extal input rise time t exr 10 5ns extal input fall time t exf 10 5ns clock cycle time t cyc 80 500 50 250 ns 20.45, 20.46 clock high pulse width t ch 30 20 ns 20.46 clock low pulse width t cl 30 20 ns clock rise time t cr 10 5ns clock fall time t cf 10 5ns reset oscillation settling time t osc1 10 10 ms 20.47 software standby oscillation settling time t osc2 10 10 ms 6 ( 2 ) control signal timing table 20.19 control signal timing 524 12.5 mhz added and description amended 12.5 mhz 20 mhz item symbol min max min max unit figure res setup time t ress 320 200 ns 20.48 res pulse width t resw 20 20 t cyc nmi reset setup time t nmirs 320 200 ns nmi reset hold time t nmirh 320 200 ns nmi setup time t nmis 160 100 ns 20.49 nmi hold time t nmih 80 50 ns irq0 irq7 setup time (edge detection) t irqes 160 100 ns irq0 irq7 setup time (level detection) t irqls 160 100 ns irq0 irq7 hold time t irqeh 80 50 ns irqout output delay time t irqod 80 50 ns 20.50 bus request setup time t brqs 80 50 ns 20.51 bus acknowledge delay time 1 t bacd1 80 50 ns bus acknowledge delay time 2 t bacd2 80 50 ns bus 3-state delay time t bzd 80 50 ns 6 ( 3 ) bus timing table 20.20 bus timing (1) 528 description amended read data access time 2 * 6 t acc2 t cyc (n+2) 30 * 3 ns 20.53, 20.54, 20.57 20.59 6 ( 3 ) bus timing table 20.20 bus timing (2) 530 to 532 newly added 6
section page description edition ( 4 ) dmac timing table 20.21 dmac timing 546 12.5 mhz added 12.5 mhz 20 mhz item symbol min max min max unit figure dreq0 , dreq1 setup time t drqs 80 27 ns 20.65 dreq0 , dreq1 hold time t drqh 30 30 ns dreq0 , dreq1 pulse width t drqw 1.5 1.5 t cyc 20.66 6 ( 5 ) 16-bit integrated timer pulse unit timing table 20.22 16-bit integrated timer pulse unit timing 547 12.5 mhz added 12.5 mhz 20 mhz item symbol min max min max unit figure output compare delay time t tocd 100 100 ns 20.67 input capture setup time t tics 50 35 ns timer clock input setup time t tcks 50 50 ns 20.68 timer clock pulse width (single edge) t tckwh/l 1.5 1.5 t cyc timer clock pulse width (both edges) t tckwl/l 2.5 2.5 t cyc 6 ( 6 ) programmable timing pattern controller and i/o port timing table 20.23 programmable timing pattern controller and i/o port timing 548 description amended conditions: v cc = 3.3 v 20 to +75 40 to +85 6 ( 7 ) watchdog timer timing table 20.24 watchdog timer timing 549 description amended conditions: v cc = 3.3 v 20 to +75 40 to +85 6 ( 8 ) serial communication interface timing table 20.25 serial communication interface timing 550 description amended conditions: v cc = 3.3 v 20 to +75 40 to +85 6 ( 9 ) a/d converter timing table 20.26 a/d converter timing 551 description amended conditions: v cc = 3.3 v 20 to +75 40 to +85 6
section page description edition 20.2.4 a/d converter characteristics table 20.27 a/d converter characteristics 554 12.5 mhz added 12.5 mhz 20 mhz item min typ max min typ max unit resolution 10 10 10 10 10 10 bit conversion time 11.2 6.7 s analog input capacitance 20 20 pf permissible signal-source impedance 1 1k ? nonlinearity error * 4.0 4.0 lsb offset error * 4.0 4.0 lsb full-scale error * 4.0 4.0 lsb quantization error * 0.5 0.5 lsb absolute accuracy 6.0 6.0 lsb note: * reference value 6 a.2.17 timer status registers 0 4 (tsr0 tsr4) table a.18 tsr0 tsr4 bit functions 581 bit amended bit bit name value description 2 overflow flag (ovf) 0 clear conditions: 0 is written in ovf after reading ovf = 1 (initial value) 1 set conditions: tcnt value overflows (h'ffff ? h'0000) or underflows (h'ffff ? h'0000) 1 input capture/compare match flag b (imfb) 0 clear conditions: 0 is written in imfb after reading imfb = 1 (initial value) 1 set conditions: (1) when grb is functioning as the output compare register, and tcnt = grb; (2) when grb is functioning as the input capture register, and the tcnt value is transferred to grb by the input capture signal 0 input capture/compare match flag a (imfa) 0 clear conditions: 0 is written in imfa after reading imfa = 1 (initial value) 1 set conditions: (1) when gra is functioning as the output compare register, and tcnt = gra; (2) when gra is functioning as the input capture register, and the tcnt value is transferred to gra by the input capture signal 6 a.2.23 timer output control register (tocr) table a.24 tocr bit functions 587 table amended bit bit name value description 1 output level select 4 (ols4) 0 reverse output of tioca3, tioca4, tiocb4 1 direct output of tioca3, tioca4, tiocb4 (initial value) 0 output level select 3 (ols3) 0 reverse output of tiocb3, tocxa4, tocxb4 1 direct output of tiocb3, tocxa4, tocxb4 (initial value) 6
section page description edition a.3 register status in reset and power- down states table a.77 register status in reset and power-down states 644 * 2 added watchdog timer (wdt) tcnt initialized initialized held held tcsr * 1 rstcr * 2 initialized serial communication smr initialized initialized initialized held interface (sci) brr scr tdr tsr held ssr initialized rdr rsr held notes: * 1 bits 7 5 (ovf, wt/it, tme) are initialized, bits 2 0 (cks2 cks0) are held. * 2 not initialized in the case of a reset by the wdt. 6

i contents section 1 overview ........................................................................................................... 1 1.1 superh microcomputer features ...................................................................................... 1 1.2 block diagram.............................................................................................................. ..... 8 1.3 pin descriptions........................................................................................................... ...... 9 1.3.1 pin arrangement .................................................................................................. 9 1.3.2 pin functions........................................................................................................ 11 1.3.3 pin layout by mode ............................................................................................. 15 section 2 cpu ..................................................................................................................... 17 2.1 register configuration ..................................................................................................... .17 2.1.1 general registers (rn) ......................................................................................... 17 2.1.2 control registers.................................................................................................. 18 2.1.3 system registers .................................................................................................. 19 2.1.4 initial values of registers .................................................................................... 19 2.2 data formats............................................................................................................... ....... 20 2.2.1 data format in registers...................................................................................... 20 2.2.2 data format in memory ....................................................................................... 20 2.2.3 immediate data format........................................................................................ 21 2.3 instruction features....................................................................................................... ..... 21 2.3.1 risc-type instruction set ................................................................................... 21 2.3.2 addressing modes................................................................................................ 24 2.3.3 instruction formats .............................................................................................. 27 2.4 instruction set............................................................................................................ ........ 31 2.4.1 instruction set by classification .......................................................................... 31 2.4.2 operation code map ............................................................................................ 42 2.5 cpu state .................................................................................................................. ........ 45 2.5.1 state transitions ................................................................................................... 45 2.5.2 power-down state................................................................................................ 48 section 3 operating modes ............................................................................................ 49 3.1 types of operating modes and their selection................................................................ 49 3.2 operating mode descriptions............................................................................................ 49 3.2.1 mode 0 (mcu mode 0)........................................................................................ 49 3.2.2 mode 1 (mcu mode 1)........................................................................................ 49 3.2.3 mode 2 (mcu mode 2)........................................................................................ 49 3.2.4 mode 7 (prom mode) ........................................................................................ 49 section 4 exception handling ........................................................................................ 51 4.1 overview................................................................................................................... ......... 51
ii 4.1.1 exception handling types and priorities............................................................. 51 4.1.2 exception handling operation ............................................................................. 53 4.1.3 exception vector table........................................................................................ 54 4.2 resets..................................................................................................................... ............ 56 4.2.1 reset types .......................................................................................................... 56 4.2.2 power-on reset.................................................................................................... 57 4.2.3 manual reset........................................................................................................ 57 4.3 address errors ............................................................................................................. ...... 58 4.3.1 address error sources.......................................................................................... 58 4.3.2 address error exception handling ...................................................................... 58 4.4 interrupts................................................................................................................. ........... 59 4.4.1 interrupt sources .................................................................................................. 59 4.4.2 interrupt priority rankings................................................................................... 59 4.4.3 interrupt exception handling ............................................................................... 60 4.5 instruction exceptions ..................................................................................................... .. 61 4.5.1 types of instruction exceptions........................................................................... 61 4.5.2 trap instruction .................................................................................................... 61 4.5.3 illegal slot instruction .......................................................................................... 62 4.5.4 general illegal instructions .................................................................................. 62 4.6 cases in which exceptions are not accepted ................................................................... 63 4.6.1 immediately after delayed branch instruction .................................................... 63 4.6.2 immediately after interrupt-disabling instruction ............................................... 63 4.7 stack status after exception handling .............................................................................. 64 4.8 notes...................................................................................................................... ............ 65 4.8.1 value of the stack pointer (sp)............................................................................ 65 4.8.2 value of the vector base register (vbr) ........................................................... 65 4.8.3 address errors caused by stacking during address error exception handling.............................................................................................. 65 section 5 interrupt controller (intc) ......................................................................... 67 5.1 overview................................................................................................................... ......... 67 5.1.1 features ................................................................................................................ 6 7 5.1.2 block diagram...................................................................................................... 67 5.1.3 pin configuration ................................................................................................. 69 5.1.4 registers ............................................................................................................... 6 9 5.2 interrupt sources.......................................................................................................... ...... 70 5.2.1 nmi interrupts...................................................................................................... 70 5.2.2 user break interrupt ............................................................................................. 70 5.2.3 irq interrupts ...................................................................................................... 70 5.2.4 on-chip interrupts................................................................................................ 71 5.2.5 interrupt exception vectors and priority rankings ............................................. 71 5.3 register descriptions...................................................................................................... ... 74 5.3.1 interrupt priority registers a e (ipra ipre) ................................................... 74
iii 5.3.2 interrupt control register (icr) .......................................................................... 75 5.4 interrupt operation ........................................................................................................ .... 76 5.4.1 interrupt sequence................................................................................................ 76 5.4.2 stack after interrupt exception handling............................................................. 78 5.5 interrupt response time.................................................................................................... 79 5.6 usage notes ................................................................................................................. ...... 80 section 6 user break controller (ubc) ..................................................................... 81 6.1 overview................................................................................................................... ......... 81 6.1.1 features ................................................................................................................ 8 1 6.1.2 block diagram...................................................................................................... 82 6.1.3 register configuration ......................................................................................... 83 6.2 register descriptions...................................................................................................... ... 84 6.2.1 break address registers (bar) .......................................................................... 84 6.2.2 break address mask register (bamr)............................................................... 85 6.2.3 break bus cycle register (bbr) ......................................................................... 86 6.3 operation .................................................................................................................. ......... 88 6.3.1 flow of user break operation ............................................................................. 88 6.3.2 break on instruction fetch cycles to on-chip memory...................................... 90 6.3.3 program counter (pc) value saved in user break interrupt exception processing............................................................................................................. 90 6.4 setting user break conditions .......................................................................................... 91 6.5 notes...................................................................................................................... ............ 92 6.5.1 on-chip memory instruction fetch ..................................................................... 92 6.5.2 instruction fetch at branches ............................................................................... 92 6.5.3 instruction fetch break ........................................................................................ 93 section 7 clock pulse generator (cpg) ..................................................................... 95 7.1 overview................................................................................................................... ......... 95 7.2 clock source............................................................................................................... ....... 95 7.2.1 connecting a crystal resonator ........................................................................... 95 7.2.2 external clock input ............................................................................................ 97 7.3 usage notes ................................................................................................................ ....... 98 section 8 bus state controller (bsc) ......................................................................... 101 8.1 overview................................................................................................................... ......... 101 8.1.1 features ................................................................................................................ 1 01 8.1.2 block diagram...................................................................................................... 102 8.1.3 pin configuration ................................................................................................. 103 8.1.4 register configuration ......................................................................................... 104 8.1.5 overview of areas................................................................................................ 105 8.2 register descriptions...................................................................................................... ... 107 8.2.1 bus control register (bcr) ................................................................................ 107
iv 8.2.2 wait state control register 1 (wcr1)................................................................ 109 8.2.3 wait state control register 2 (wcr2)................................................................ 111 8.2.4 wait state control register 3 (wcr3)................................................................ 113 8.2.5 dram area control register (dcr).................................................................. 114 8.2.6 refresh control register (rcr) .......................................................................... 117 8.2.7 refresh timer control/status register (rtcsr) ................................................ 118 8.2.8 refresh timer counter (rtcnt) ........................................................................ 120 8.2.9 refresh time constant register (rtcor).......................................................... 120 8.2.10 parity control register (pcr).............................................................................. 121 8.2.11 notes on register access ..................................................................................... 123 8.3 address space subdivision................................................................................................ 12 4 8.3.1 address spaces and areas.................................................................................... 124 8.3.2 bus width............................................................................................................. 126 8.3.3 chip select signals ( cs0 cs7 back breq
v section 9 direct memory access controller (dmac) .......................................... 175 9.1 overview................................................................................................................... ......... 175 9.1.1 features ................................................................................................................ 1 75 9.1.2 block diagram...................................................................................................... 176 9.1.3 pin configuration ................................................................................................. 178 9.1.4 register configuration ......................................................................................... 179 9.2 register descriptions ...................................................................................................... .. 180 9.2.1 dma source address registers 0 3 (sar0 sar3) .......................................... 180 9.2.2 dma destination address registers 0 3 (dar0 dar3).................................. 180 9.2.3 dma transfer count registers 0 3 (tcr0 tcr3) ........................................... 181 9.2.4 dma channel control registers 0 3 (chcr0 chcr3)................................... 181 9.2.5 dma operation register (dmaor)................................................................... 186 9.3 operation .................................................................................................................. ......... 188 9.3.1 dma transfer flow ............................................................................................. 188 9.3.2 dma transfer requests....................................................................................... 190 9.3.3 channel priority.................................................................................................... 192 9.3.4 dma transfer types ........................................................................................... 197 9.3.5 number of bus cycle states and dreq
vi 10.2.9 timer control register (tcr) ............................................................................. 242 10.2.10 timer i/o control register (tior) ..................................................................... 244 10.2.11 timer status register (tsr) ................................................................................ 246 10.2.12 timer interrupt enable register (tier) .............................................................. 247 10.3 cpu interface ............................................................................................................. ....... 249 10.3.1 16-bit accessible registers.................................................................................. 249 10.3.2 8-bit accessible registers.................................................................................... 251 10.4 operation ................................................................................................................. .......... 252 10.4.1 overview .............................................................................................................. 25 2 10.4.2 basic functions .................................................................................................... 253 10.4.3 synchronizing mode ............................................................................................ 262 10.4.4 pwm mode .......................................................................................................... 264 10.4.5 reset-synchronized pwm mode ......................................................................... 268 10.4.6 complementary pwm mode ............................................................................... 271 10.4.7 phase counting mode .......................................................................................... 278 10.4.8 buffer mode ......................................................................................................... 280 10.4.9 itu output timing .............................................................................................. 285 10.5 interrupts................................................................................................................ ............ 286 10.5.1 timing of setting status flags ............................................................................. 286 10.5.2 status flag clear timing...................................................................................... 288 10.5.3 interrupt sources and dmac activation............................................................. 289 10.6 notes and precautions..................................................................................................... ... 290 10.6.1 contention between tcnt write and clear........................................................ 290 10.6.2 contention between tcnt word write and increment ...................................... 291 10.6.3 contention between tcnt byte write and increment........................................ 292 10.6.4 contention between gr write and compare match............................................ 293 10.6.5 contention between tcnt write and overflow/underflow ............................... 294 10.6.6 contention between general register read and input capture ........................... 295 10.6.7 contention between counter clearing by input capture and counter increment................................................................................................ 296 10.6.8 contention between general register write and input capture.......................... 297 10.6.9 note on waveform cycle setting ........................................................................ 297 10.6.10 contention between br write and input capture................................................ 298 10.6.11 note on writing in synchronizing mode ............................................................. 299 10.6.12 note on setting reset-synchronized pwm mode/complementary pwm mode .......................................................................................................... 299 10.6.13 clearing complementary pwm mode ................................................................ 300 10.6.14 note on counter clearing by input capture......................................................... 300 10.6.15 itu operating modes .......................................................................................... 301 section 11 programmable timing pattern controller (tpc) .................................. 309 11.1 overview.................................................................................................................. .......... 309 11.1.1 features ................................................................................................................ 309
vii 11.1.2 block diagram...................................................................................................... 310 11.1.3 input/output pins.................................................................................................. 311 11.1.4 registers ............................................................................................................... 312 11.2 register descriptions..................................................................................................... .... 313 11.2.1 port b control registers 1 and 2 (pbcr1, pcbr2)............................................ 313 11.2.2 port b data register (pbdr)............................................................................... 314 11.2.3 next data register a (ndra) ............................................................................ 314 11.2.4 next data register b (ndrb) ............................................................................. 316 11.2.5 next data enable register a (ndera).............................................................. 318 11.2.6 next data enable register b (nderb) .............................................................. 318 11.2.7 tpc output control register (tpcr) ................................................................. 319 11.2.8 tpc output mode register (tpmr) ................................................................... 321 11.3 operation ................................................................................................................. .......... 322 11.3.1 overview .............................................................................................................. 32 2 11.3.2 output timing ...................................................................................................... 323 11.3.3 examples of use of ordinary tpc output .......................................................... 324 11.3.4 tpc output non-overlap operation.................................................................... 327 11.3.5 tpc output by input capture .............................................................................. 331 11.4 usage notes ............................................................................................................... ........ 332 11.4.1 non-overlap operation........................................................................................ 332 section 12 watchdog timer (wdt) .............................................................................. 335 12.1 overview.................................................................................................................. .......... 335 12.1.1 features ................................................................................................................ 335 12.1.2 block diagram...................................................................................................... 336 12.1.3 pin configuration ................................................................................................. 336 12.1.4 register configuration ......................................................................................... 337 12.2 register descriptions..................................................................................................... .... 337 12.2.1 timer counter (tcnt) ........................................................................................ 337 12.2.2 timer control/status register (tcsr) ................................................................ 338 12.2.3 reset control/status register (rstcsr) ............................................................ 339 12.2.4 notes on register access ..................................................................................... 340 12.3 operation ................................................................................................................. .......... 342 12.3.1 operation in watchdog timer mode ................................................................... 342 12.3.2 operation in interval timer mode ....................................................................... 344 12.3.3 operation in standby mode.................................................................................. 344 12.3.4 timing of overflow flag (ovf) setting.............................................................. 345 12.3.5 timing of watchdog timer overflow flag (wovf) setting.............................. 345 12.4 usage notes ............................................................................................................... ........ 346 12.4.1 tcnt write and increment contention............................................................... 346 12.4.2 changing cks2 cks0 bit values...................................................................... 346 12.4.3 changing watchdog timer/interval timer modes .............................................. 346 12.4.4 system reset with wdtovf
viii 12.4.5 internal reset with watchdog timer .................................................................. 347 section 13 serial communication interface (sci) .................................................... 349 13.1 overview.................................................................................................................. .......... 349 13.1.1 features ................................................................................................................ 349 13.1.2 block diagram...................................................................................................... 350 13.1.3 input/output pins.................................................................................................. 351 13.1.4 register configuration ......................................................................................... 351 13.2 register descriptions..................................................................................................... .... 352 13.2.1 receive shift register .......................................................................................... 352 13.2.2 receive data register .......................................................................................... 352 13.2.3 transmit shift register ........................................................................................ 353 13.2.4 transmit data register......................................................................................... 353 13.2.5 serial mode register ............................................................................................ 354 13.2.6 serial control register ......................................................................................... 356 13.2.7 serial status register............................................................................................ 359 13.2.8 bit rate register (brr)....................................................................................... 363 13.3 operation ................................................................................................................. .......... 372 13.3.1 overview .............................................................................................................. 37 2 13.3.2 operation in asynchronous mode........................................................................ 374 13.3.3 multiprocessor communication ........................................................................... 385 13.3.4 synchronous operation ........................................................................................ 393 13.4 sci interrupt sources and the dmac............................................................................... 403 13.5 usage notes ............................................................................................................... ........ 403 section 14 a/d converter ................................................................................................. 407 14.1 overview.................................................................................................................. .......... 407 14.1.1 features ................................................................................................................ 407 14.1.2 block diagram...................................................................................................... 408 14.1.3 configuration of input pins.................................................................................. 409 14.1.4 configuration of a/d registers............................................................................ 410 14.2 register descriptions..................................................................................................... .... 410 14.2.1 a/d data registers a d (addra addrd).................................................... 410 14.2.2 a/d control/status register (adcsr)................................................................ 411 14.2.3 a/d control register (adcr)............................................................................. 413 14.3 cpu interface ............................................................................................................. ....... 414 14.4 operation ................................................................................................................. .......... 416 14.4.1 single mode (scan = 0) ..................................................................................... 416 14.4.2 scan mode (scan = 1) ....................................................................................... 418 14.4.3 input sampling time and a/d conversion time ................................................ 420 14.4.4 a/d conversion start by external trigger input ................................................. 421 14.5 interrupts and dma transfer requests ............................................................................ 421 14.6 definitions of a/d conversion accuracy ......................................................................... 422
ix 14.7 a/d converter usage notes.............................................................................................. 423 14.7.1 setting analog input voltage............................................................................... 423 14.7.2 handling of analog input pins............................................................................. 423 14.7.3 switchover between analog input and general port functions .......................... 424 section 15 pin function controller (pfc) .................................................................... 425 15.1 overview.................................................................................................................. .......... 425 15.2 register configuration .................................................................................................... .. 427 15.3 register descriptions..................................................................................................... .... 427 15.3.1 port a i/o register (paior) ............................................................................... 427 15.3.2 port a control registers (pacr1 and pacr2) .................................................. 428 15.3.3 port b i/o register (pbior)................................................................................ 433 15.3.4 port b control registers (pbcr1 and pbcr2)................................................... 434 15.3.5 column address strobe pin control register (cascr) ..................................... 439 section 16 i/o ports (i/o) .................................................................................................. 441 16.1 overview.................................................................................................................. .......... 441 16.2 port a.................................................................................................................... ............. 441 16.2.1 register configuration ......................................................................................... 441 16.2.2 port a data register (padr) .............................................................................. 442 16.3 port b .................................................................................................................... ............. 443 16.3.1 register configuration ......................................................................................... 443 16.3.2 port b data register (pbdr)............................................................................... 444 16.4 port c .................................................................................................................... ............. 445 16.4.1 register configuration ......................................................................................... 445 16.4.2 port c data register (pcdr)............................................................................... 446 section 17 rom ................................................................................................................... 447 17.1 overview.................................................................................................................. .......... 447 17.2 prom mode................................................................................................................. ..... 448 17.2.1 setting prom mode............................................................................................ 448 17.2.2 socket adapter pin correspondence and memory map ...................................... 448 17.3 prom programming ......................................................................................................... 4 50 17.3.1 selecting the programming mode........................................................................ 450 17.3.2 write/verify and electrical characteristics.......................................................... 451 17.3.3 notes on writing .................................................................................................. 455 17.3.4 reliability after writing ....................................................................................... 456 section 18 ram ................................................................................................................... 457 18.1 overview.................................................................................................................. .......... 457 18.2 operation ................................................................................................................. .......... 458
x section 19 power-down state .......................................................................................... 459 19.1 overview.................................................................................................................. .......... 459 19.1.1 power-down modes............................................................................................. 459 19.1.2 register................................................................................................................ . 460 19.2 standby control register (sbycr).................................................................................. 460 19.3 sleep mode................................................................................................................ ........ 461 19.3.1 transition to sleep mode ..................................................................................... 461 19.3.2 exiting sleep mode .............................................................................................. 461 19.4 standby mode.............................................................................................................. ...... 461 19.4.1 transition to standby mode ................................................................................. 461 19.4.2 exiting standby mode.......................................................................................... 463 19.4.3 standby mode application................................................................................... 463 section 20 electrical characteristics .............................................................................. 465 20.1 sh7032 and sh7034 electrical characteristics ................................................................ 465 20.1.1 absolute maximum ratings ................................................................................. 465 20.1.2 dc characteristics................................................................................................ 465 20.1.3 ac characteristics................................................................................................ 472 ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( )
xi ( ) dl (addrah addrl) a/d...................................... 571 a.2.8 a/d control/status register (adcsr) a/d........................................................ 571 a.2.9 a/d control register (adcr) a/d ..................................................................... 573 a.2.10 timer start register (tstr) itu ........................................................................ 573 a.2.11 timer synchronization register (tsnc) itu ..................................................... 574 a.2.12 timer mode register (tmdr) itu..................................................................... 576 a.2.13 timer function control register (tfcr) itu .................................................... 577 a.2.14 timer control registers 0 4 (tcr0 tcr4) itu ............................................... 578 a.2.15 timer i/o control registers 0 4 (tior0 tior4) itu...................................... 579 a.2.16 timer interrupt enable registers 0 4 (tier0 tier4) itu ............................... 580 a.2.17 timer status registers 0 4 (tsr0 tsr4) itu .................................................. 581 a.2.18 timer counter 0 4 (tcnt0 tcnt4) itu ......................................................... 582 a.2.19 general registers a0 4 (gra0 gra4) itu ..................................................... 583 a.2.20 general registers b0 4 (grb0 grb4) itu ...................................................... 584 a.2.21 buffer registers a3, 4 (bra3, bra4) itu ........................................................ 585 a.2.22 buffer registers b3, 4 (brb3, brb4) itu......................................................... 586 a.2.23 timer output control register (tocr) itu ...................................................... 587 a.2.24 dma source address registers 0 3 (sar0 sar3) dmac ............................. 588 a.2.25 dma destination address registers 0 3 (dar0 dar3) dmac..................... 589 a.2.26 dma transfer count registers 0 3 (tcr0 tcr3) dmac .............................. 590 a.2.27 dma channel control registers 0 3 (chcr0 chcr3) dmac...................... 591 a.2.28 dma operation registers (dmaor) dmac .................................................... 594 a.2.29 interrupt priority setting register a (ipra) intc ............................................. 595 a.2.30 interrupt priority setting register b (iprb) intc.............................................. 596 a.2.31 interrupt priority setting register c (iprc) intc.............................................. 597 a.2.32 interrupt priority setting register d (iprd) intc ............................................. 598 a.2.33 interrupt priority setting register e (ipre) intc .............................................. 599 a.2.34 interrupt control register (icr) intc................................................................ 600 a.2.35 break address register h (barh) ubc ............................................................ 601 a.2.36 break address register l (barl) ubc ............................................................. 602 a.2.37 break address mask register h (bamrh) ubc............................................... 603
xii a.2.38 break address mask register l (bamrl) ubc................................................ 604 a.2.39 break bus cycle register (bbr) ubc................................................................ 605 a.2.40 bus control register (bcr) bsc........................................................................ 606 a.2.41 wait state control register 1 (wcr1) bsc ....................................................... 607 a.2.42 wait state control register 2 (wcr2) bsc ....................................................... 608 a.2.43 wait state control register 3 (wcr3) bsc ....................................................... 610 a.2.44 dram area control register (dcr) bsc ......................................................... 611 a.2.45 parity control register (pcr) bsc ..................................................................... 613 a.2.46 refresh control register (rcr) bsc.................................................................. 614 a.2.47 refresh timer control/status register (rtcsr) bsc........................................ 615 a.2.48 refresh timer counter (rtcnt) bsc................................................................ 616 a.2.49 refresh timer constant register (rtcor) bsc................................................ 617 a.2.50 timer control/status register (tcsr) wdt ...................................................... 617 a.2.51 timer counter (tcnt) wdt .............................................................................. 619 a.2.52 reset control/status register (rstcsr) wdt .................................................. 619 a.2.53 standby control register (sbycr) power-down state ..................................... 620 a.2.54 port a data register (padr) port a................................................................... 621 a.2.55 port b data register (pbdr) port b ................................................................... 622 a.2.56 port c data register (pcdr) port c ................................................................... 623 a.2.57 port a i/o register (paior) pfc ....................................................................... 624 a.2.58 port b i/o register (pbior) pfc........................................................................ 625 a.2.59 port a control register 1 (pacr1) pfc............................................................. 626 a.2.60 port a control register 2 (pacr2) pfc............................................................. 628 a.2.61 port b control register 1 (pbcr1) pfc ............................................................. 630 a.2.62 port b control register 2 (pbcr2) pfc ............................................................. 632 a.2.63 column address strobe pin control register (cascr) pfc............................. 634 a.2.64 tpc output mode register (tpmr) tpc ........................................................... 635 a.2.65 tpc output control register (tpcr) tpc ......................................................... 636 a.2.66 next data enable register a (ndera) tpc...................................................... 638 a.2.67 next data enable register b (nderb) tpc ...................................................... 638 a.2.68 next data register a (ndra) tpc (when the output triggers of tpc output groups 0 and 1 are the same) ......... 639 a.2.69 next data register a (ndra) tpc (when the output triggers of tpc output groups 0 and 1 are the same) ......... 639 a.2.70 next data register a (ndra) tpc (when the output triggers of tpc output groups 0 and 1 are different) ......... 640 a.2.71 next data register a (ndra) tpc (when the output triggers of tpc output groups 0 and 1 are different) ......... 640 a.2.72 next data register b (ndrb) tpc (when the output triggers of tpc output groups 2 and 3 are the same) ......... 641 a.2.73 next data register b (ndrb) tpc (when the output triggers of tpc output groups 2 and 3 are the same) ......... 641
xiii a.2.74 next data register b (ndrb) tpc (when the output triggers of tpc output groups 2 and 3 are different) ......... 642 a.2.75 next data register b (ndrb) tpc (when the output triggers of tpc output groups 2 and 3 are different).......... 642 a.3 register status in reset and power-down states.............................................................. 643 appendix b pin states ........................................................................................................ 646 appendix c package dimensions ................................................................................... 652
xiv
1 section 1 overview 1.1 superh microcomputer features superh microcomputers (sh7000 series) comprise a new generation of reduced instruction set computers (risc) in which a hitachi-original cpu and the peripheral functions required for system configuration are integrated onto a single chip. the cpu has a risc-type instruction set. most instructions can be executed in one system clock cycle, which strikingly improves instruction execution speed. in addition, the cpu has a 32-bit internal architecture for enhanced data-processing ability. as a result, the cpu enables high- performance systems to be constructed with advanced functionality at low cost, even in applications such as realtime control that require very high speeds, an impossibility with conventional microcomputers. sh microcomputers include peripheral functions such as large-capacity rom, ram, a direct memory access controller (dmac), timers, a serial communication interface (sci), an a/d converter, an interrupt controller (intc), and i/o ports. external memory access support functions enable direct connection to sram and dram. these features can drastically reduce system cost. for on-chip rom, masked rom or electrically programmable rom (prom) can be selected. the prom version can be programmed by users with a general-purpose prom programmer. table 1.1 lists the features of the sh microcomputers (sh7032 and sh7034).
2 table 1.1 features of the sh7032 and sh7034 microcomputers feature description cpu original hitachi architecture 32-bit internal data paths general-register machine: ? sixteen 32-bit general registers ? three 32-bit control registers ? four 32-bit system registers risc-type instruction set: ? instruction length: 16-bit fixed length for improved code efficiency ? load-store architecture (basic arithmetic and logic operations are executed between registers) ? delayed unconditional branch instructions reduce pipeline disruption ? instruction set optimized for c language instruction execution time: one instruction/cycle (50 ns/instruction at 20- mhz operation) address space: 4 gbytes available in the architecture on-chip multiplier: multiplication operations (16 bits 16 bits 32 bits) executed in 1? cycles, and multiplication/accumulation operations (16 bits 16 bits + 42 bits 42 bits) executed in 2? cycles five-stage pipeline operating modes operating modes: ?on-chip romless mode ?on-chip rom mode (sh7034 only) processing states: ? power-on reset state ? manual reset state ? exception handling state ? program execution state ? power-down state ? bus-released state power-down states: ? sleep mode ? software standby mode
3 table 1.1 features of the sh7032 and sh7034 microcomputers (cont) feature description interrupt controller nine external interrupt pins (nmi, irq0 irq7 ) (intc) thirty-one internal interrupt sources sixteen programmable priority levels user break controller (ubc) generates an interrupt when the cpu or dmac generates a bus cycle with specified conditions simplifies configuration of an on-chip debugger clock pulse generator (cpg) on-chip clock pulse generator (maximum operating frequency: 20 mhz): ? 20-mhz pulses can be generated from a 20-mhz crystal with a duty cycle correcting circuit bus state controller (bsc) supports external memory access: ? sixteen-bit external data bus address space divided into eight areas with the following preset features: ? bus size (8 or 16 bits) ? number of wait cycles can be defined by user. ? type of area (external memory area, dram area, etc.) ? simplifies connection to rom, sram, dram, and peripheral i/o ? when the dram area is accessed: ? ras and cas signals for dram are output ? tp cycles can be generated to assure ras precharge time ? address multiplexing is supported internally, so dram can be connected directly ? chip select signals ( cs0 to cs7 ) are output for each area dram refresh function: ? programmable refresh interval ? supports cas-before-ras refresh and self-refresh modes dram burst access function: ? supports high-speed access modes for dram wait cycles can be inserted by an external wait signal one-stage write buffer improves the system performance data bus parity can be generated and checked
4 table 1.1 features of the sh7032 and sh7034 microcomputers (cont) feature description direct memory access controller (dmac) (4 channels) permits dma transfer between the following modules: ? external memory ? external i/o ? on-chip memory ? peripheral on-chip modules (except dmac) dma transfer can be requested from external pins, on-chip sci, on-chip timers, and on-chip a/d converter cycle-steal mode or burst mode channel priority level is selectable channels 0 and 1: dual or single address transfer mode is selectable; external request sources are supported; channels 2 and 3: dual address transfer mode, internal request sources only 16-bit integrated ten types of waveforms can be output t i me r pulse unit (itu) input pulse width and cycle can be measured pwm mode: pulse output with 0?00% duty cycle (maximum resolution: 50 ns) complementary pwm mode: can output a maximum of three pairs of non- overlapping pwm waveforms phase counting mode: can count up or down according to the phase of an external two-phase clock timing pattern maximum 16-bit output (4 bits 4 channels) can be output controller (tpc) non-overlap intervals can be established between pairs of waveforms timing-source timer is selectable watchdog timer can be used as watchdog timer or interval timer (wdt) (1 channel) timer overflow can generate an internal reset, external signal, or interrupt power-on reset or manual reset can be selected as the internal reset asynchronous or synchronous mode is selectable can transmit and receive simultaneously (full duplex) on-chip baud rate generator in each channel multiprocessor communication function a/d converter ten bits 8 channels can be externally triggered variable reference voltage serial communication interface (sci) (2 channels)
5 table 1.1 features of the sh7032 and sh7034 microcomputers (cont) feature description i/o ports total of 40 i/o lines (32 input/output lines, 8 input-only lines): ? port a: 16 input/output lines (input or output can be selected for each bit) ? port b: 16 input/output lines (input or output can be selected for each bit) ? port c: 8 input lines large on-chip memory sh7034 (on-chip rom version): 64-kbyte electrically programmable rom or masked rom, and 4-kbyte ram sh7032 (romless version): 8-kbyte ram 32-bit data can be accessed in one clock cycle
6 table 1.2 product lineup product number on-chip rom operating voltage operating frequency temperature range model marking model no. * 2 package sh7032 romless 5.0 v 2 to 20 mhz -20 to +75 c hd6417032f20 hd6417032f20 112-pin plastic -40 to +85 c hd6417032fi20 hd6417032fi20 qfp (fp-112) 3.3 v 2 to 12.5 mhz -20 to +75 c hd6417032vf12 hd6417032vf12 -40 to +85 c hd6417032vfi12 hd6417032vfi12 5.0 v 2 to 20 mhz -20 to +75 c hd6417032x20 hd6417032te20 120-pin plastic -40 to +85 c hd6417032xi20 hd6417032tei20 tqfp (tfp-120) 3.3 v 2 to 12.5 mhz -20 to +75 c hd6417032vx12 hd6417032vte12 -40 to +85 c hd6417032vxi12 hd6417032vtei12 sh7034 prom 5.0 v 2 to 20 mhz -20 to +75 c hd6477034f20 hd6477034f20 112-pin plastic -40 to +85 c hd6477034fi20 hd6477034fi20 qfp (fp-112) 3.3 v 2 to12.5 mhz -20 to +75 c hd6 4 7 70 3 4 v f1 2 hd6 4 7 70 3 4 v f1 2 -40 to +85 c hd6 4 7 70 3 4 v fi 1 2 hd6 4 7 70 3 4 v fi 1 2 5.0 v 2 to 20 mhz -20 to +75 c hd6477034x20 hd6 4 7 70 3 4 te 2 0 120-pin plastic -40 to +85 c hd6477034xi20 hd6 4 7 70 3 4 te i 2 0 tqfp (tfp-120) 3.3 v 2 to 12.5 mhz -20 to +75 c hd6 4 7 70 3 4 v x 1 2 hd6 4 7 70 3 4 v te 1 2 -40 to +85 c hd6 4 7 70 3 4 v x i 1 2 hd6 4 7 70 3 4 v te i 1 2 mask 5.0 v 2 to 20 mhz -20 to +75 c HD6437034af20 HD6437034af20 112-pin plastic rom -40 to +85 c HD6437034afi20 HD6437034afi20 qfp (fp-112) 3.3 v 2 to 12.5 mhz -20 to +75 c HD6437034avf12 HD6437034af12 -40 to +85 c HD6437034avfi12 HD6437034afi12 5.0 v 2 to 20 mhz -20 to +75 c HD6437034ax20 HD6437034ate20 120-pin plastic -40 to +85 c HD6437034axi20 HD6437034atei20 tqfp (tfp-120) 3.3 v 2 to 12.5 mhz -20 to +75 c hd6437 0 3 4 a vx 1 2 HD6437034ate12 -40 to +85 c HD6437034avxi12 HD6437034atei12 romless 5.0 v 2 to 20 mhz -20 to +75 c hd6417034f20 hd6417034f20 112-pin plastic -40 to +85 c hd6417034fi20 hd6417034fi20 qfp (fp-112) 3.3 v 2 to 12.5 mhz -20 to +75 c hd6417034vf12 hd6417034vf12 -40 to +85 c hd6417034vfi12 hd6417034vfi12 5.0 v 2 to 20 mhz -20 to +75 c hd6417034x20 hd6417034te20 120-pin plastic -40 to +85 c hd6417034xi20 hd6417034tei20 tqfp (tfp-120) 3.3 v 2 to 12.5 mhz -20 to +75 c hd6417034vx12 hd6417034vte12 -40 to +85 c hd6417034vxi12 hd6417034vtei12
7 table 1.2 product lineup (cont) product number on-chip rom operating voltage operating frequency temperature range model marking model no. * 2 package sh7034b * 1 mask 3.3 v 4 to 12.5 mhz -20 to +75 c HD6437034bvf12 6437034b( *** )f 112-pin plastic rom -40 to +85 c HD6437034bvfw12 6437034b( *** )fw qfp (fp-112) -20 to +75 c HD6437034bvx12 6437034b (*** )x 120-pin plastic -40 to +85 c HD6437034bvxw12 6437034b( *** )xw tqfp (tfp-120) romless 3.3 v 4 to 20 mhz -20 to +75 c hd6417034bvf20 hd6417034bvf20 112-pin plastic -40 to +85 c hd6417034bvfw20 hd6417034bvfw20 qfp (fp-112) -20 to +75 c hd6417034bvx20 6417034bvte20 120-pin plastic -40 to +85 c hd6417034bvxw20 6417034bvtew20 tqfp (tfp-120) notes: * 1 the electrical characteristics of the sh7034b mask rom version and sh7034 prom version are different. * 2 for mask rom versions, ( *** ) is the rom code.
8 1.2 block diagram a15 a14 a13 a12 a11 a10 a9 a8 a7 a6 a5 a4 a3 a2 a1 a0 ( hbs * 2 v cc v cc v cc v cc v cc v cc v cc v ss v ss v ss v ss v ss v ss v ss av ref av cc res wdtovf cs3 casl cs2 cs1 cash cs0 irq3 dreq1 irq2 irq1 dreq0 irq0 ah irqout adtrg breq back rd wrh lbs wrl wr cs7 wait cs6 cs5 ras cs4 irq7 irq6 irq5 irq4 : peripheral address bus (24 bits) : peripheral data bus (16 bits) : internal address bus (24 bits) : internal upper data bus (16 bits) : internal lower data bus (16 bits) port a address address data/address port b port c clock pulse generator prom or masked rom * 1 ram * 1 cpu direct memory access controller interrupt controller user break controller bus state controller serial communi- cation interface (2 channels) 16-bit integrated timer pulse unit programmable timing pattern controller a/d converter watchdog timer v ss v ss v ss av ss notes: * 1 the sh7032 has 8 kb of ram and no prom or masked rom. the sh7034 has 4 kb of ram and 64 kb of prom or masked rom. * 2v pp : sh7034 (prom version) figure 1.1 block diagram
9 1.3 pin descriptions 1.3.1 pin arrangement pb13/tp13/irq5/sck1 pb12/tp12/irq4/sck0 pb11/tp11/txd1 pb10/tp10/rxd1 pb9/tp9/txd0 pb8/tp8/rxd0 v ss pb7/tp7/tocxb4/tclkd pb6/tp6/tocxa4/tclkc pb5/tp5/tiocb4 pb4/tp4/tioca4 pb3/tp3/tiocb3 pb2/tp2/tioca3 v cc pb1/tp1/tiocb2 pb0/tp0/tioca2 v ss pc7/an7 pc6/an6 pc5/an5 pc4/an4 av ss pc3/an3 pc2/an2 pc1/an1 pc0/an0 av ref av cc 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 a6 a7 v ss a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18 a19 a20 a21 cs0 cs1/cash cs2 cs3/casl v ss pa0/cs4/tioca0 pa1/cs5/ras pa2/cs6/tiocb0 pa3/cs7/wait v cc v cc md2 md1 md0 res wdtovf v cc (v pp ) * 1 nmi v cc xtal extal v ss ck v cc pa15/irq3/dreq1 pa14/irq2/dack1 * 2 pa13/ irq1 dreq0 irq0 * 2 /tclka pa11/dph/tiocb1 pa10/dpl/tioca1 pa9/ ah irqout adtrg irq6 irq7 * 1v pp : sh7034 (prom version) only * 2 initial value (output) figure 1.2 pin arrangement (fp-112)
10 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 nc * 3 pa3/cs7/wait pa2/cs6/tiocb0 pa1/cs5/ras pa0/cs4/tioca0 v ss cs3/casl cs2 cs1/cash cs0 a21 a20 a19 a18 v cc a17 a16 v ss a15 a14 a13 a12 a11 a10 a9 a8 v ss a7 a6 nc * 3 av cc av ref pc0/an0 pc1/an1 pc2/an2 pc3/an3 av ss pc4/an4 pc5/an5 pc6/an6 pc7/an7 v ss pb0/tp0/tioca2 nc * 3 pb1/tp1/tiocb2 v cc pb2/tp2/tioca3 pb3/tp3/tiocb3 pb4/tp4/tioca4 pb5/tp5/tiocb4 pb6/tp6/tocxa4/tclkc pb7/tp7/tocxb4/tclkd v ss pb8/tp8/rxd0 pb9/tp9/txd0 pb10/tp10/rxd1 pb11/tp11/txd1 pb12/tp12/irq4/sck0 pb13/tp13/irq5/sck1 nc * 3 v cc v cc md2 md1 md0 res wdtovf v cc (v pp ) * 1 nmi v cc xtal extal v ss ck v cc pa15/irq3/dreq1 pa14/irq2/dack1 * 2 pa13/ irq1 dreq0 irq0 * 2 /tclka pa11/dph/tiocb1 pa10/dpl/tioca1 pa9/ ah irqout adtrg * 3 nc * 3 84 83 82 81 80 79 90 89 88 87 86 85 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 pb14/tp14/ irq6 irq7 * 3 nc * 3 v ss ad8 ad9 a0(hbs) top view (tfp-120) notes: * 1v pp : sh7034 (prom version) only * 2 initial value (output) * 3 do not make any connection. figure 1.3 pin arrangement (tfp-120)
11 1.3.2 pin functions table 1.3 describes the pin functions. table 1.3 pin functions type symbol pin no. (fp-112) pin no. (tfp-120) i/o name and function power v cc 15, 43, 70, 75, 77 * , 83, 84, 99 16, 46, 75, 80, 82 * , 88, 89, 106 i power: connected to the power supply. connect all v cc pins to the system power supply . the chip will not operate if any v cc pin is left unconnected. v ss 3, 12, 22, 31, 40, 52, 61, 72, 96, 106 4, 13, 23, 34, 43, 55, 66, 77, 102, 113 i ground: connected to ground. connect all v ss pins to the system ground. the chip will not operate if any v ss pin is left unconnected. v pp 77 * 82 * i prom programming power supply: connected to the power supply (v cc ) during normal operation. apply +12.5 v when programming the prom in the sh7034 (prom version). clock extal 73 78 i external clock: connected to a crystal resonator or external clock input having the same frequency as the system clock (ck). xtal 74 79 i crystal: connected to a crystal resonator with the same frequency as the system clock (ck). if an external clock is input at the extal pin, leave xtal open. ck 71 76 o system clock: supplies the system clock (ck) to peripheral devices. system control res wdtovf breq back back breq * pin 77 is v cc in the sh7032 and sh7034 (masked rom version), and v pp in the sh7034 (prom version).
12 table 1.3 pin functions (cont) type symbol pin no. (fp-112) pin no. (tfp-120) i/o name and function operating mode control md2, md1, md0 82, 81, 80 87, 86, 85 i mode select: selects the operating mode. do not change these inputs while the chip is operating. the following table lists the possible operating modes and their corresponding md2 md0 values. md2 md1 md0 operating mode on-chip rom bus size in area 0 0 0 0 mcu disabled 8 bits 001 mode 16 bits 0 1 0 enabled * 1 011 (reserved) 100 101 110 1 1 1 prom mode * 2 interrupts nmi 76 81 i nonmaskable interrupt: nonmaskable interrupt request signal. the rising or falling edge can be selected for signal detection. irq0 irq7 69, 111, 112, 1, 2 71 74, 118, 119, 2, 3 i interrupt request 0 7: maskable interrupt request signals. level input or edge-triggered input can be selected. irqout a0 47 44, 42, 41, 39 32, 30 23 50 47, 45, 44, 42 35, 33, 32, 29 24 o address bus: outputs addresses. data bus ad15 ad0 21 16, 14, 13, 11 4 22 17, 15, 14, 12 5 i/o data bus: 16-bit bidirectional data bus that is multiplexed with the lower 16 bits of the address bus. dph 65 70 i/o upper data bus parity: parity data for d15 d8. dpl 64 69 i/o lower data bus parity: parity data for d7 d0. notes: * 1 use prohibited in the sh7032 and sh7034 rom-less versions. * 2 can be used in the sh7034 prom version.
13 table 1.3 pin functions (cont) type symbol pin no. (fp-112) pin no. (tfp-120) i/o name and function bus control (cont) wait ras cash casl rd wrh wrl cs0 cs7 51, 53 56 51 54, 56 59 o chip select 0 7: chip select signals for accessing external memory and devices. ah hbs lbs wrh wr wrl dreq0 dreq1
14 table 1.3 pin functions (cont) type symbol pin no. (fp-112) pin no. (tfp-120) i/o name and function tioca4, tiocb4 102, 103 109, 110 i/o itu input capture/output compare (channel 4): input capture or output compare pins. tocxa4, tocxb4 104, 105 111, 112 o itu output compare (channel 4): output compare pins. tclka tclkd 66, 67, 104, 105 71, 72, 111, 112 i itu timer clock input: external clock input pins for itu counters. timing pattern controller (tpc) tp15 tp0 2, 1, 112 107, 105 100, 98, 97 3, 2, 119 114, 112 107, 105, 103 o timing pattern output 15-0: timing pattern output pins. txd0, txd1 108, 110 115, 117 o transmit data (channels 0 and 1): transmit data output pins for sci0 and sci1. rxd0, rxd1 107, 109 114, 116 i receive data (channels 0 and 1): receive data input pins for sci0 and sci1. sck0, sck1 111, 112 118, 119 i/o serial clock (channels 0 and 1): clock input/output pins for sci0 and sci1. a/d converter an7 an0 95 92, 90 87 101 98, 96 93 i analog input: analog signal input pins. adtrg pa0 69 62, 60 53 74 67, 65 62, 59 56 i/o port a: 16-bit input/output pins. input or output can be selected individually for each bit. pb15 pb0 2, 1, 112 107, 105 100, 98, 97 3, 2, 119 114, 112 107, 105, 103 i/o port b: 16-bit input/output pins. input or output can be selected individually for each bit. pc7 pc0 95 92, 90 87 101 98, 96 93 i port c: 8-bit input pins. 16-bit integrated timer pulse unit (itu) serial com- munication interface (sci)
15 1.3.3 pin layout by mode table 1.4 pin layout by mode pin no. (fp-112) pin no. (tfp-120) mcu mode prom mode (sh7034 prom version) pin no. (fp-112) pin no. (tfp-120) mcu mode prom mode (sh7034 prom version) 1nc nc 31 nc nc 1 2 pb14/tp14/ irq6 irq7 oe cs0 cs1 cash cs2 hbs cs3 casl cs4 cs5 ras cs6 pgm cs7 wait ce 30 nc nc 60 nc nc
16 table 1.4 pin layout by mode (cont) pin no. (fp-112) pin no. (tfp-120) mcu mode prom mode (sh7034 prom version) pin no. (fp-112) pin no. (tfp-120) mcu mode prom mode (sh7034 prom version) 61 nc nc 85 91 av cc v cc 57 62 pa4/ wrl wr wrh lbs rd /back breq ah irqout adtrg irq0 irq1 dreq0 irq2 irq3 dreq1 104 nc nc 70 75 v cc v cc 98 105 pb1/tp1/tiocb2 nc 71 76 ck nc 99 106 v cc v cc 72 77 v ss v ss 100 107 pb2/tp2/tioca3 nc 73 78 extal nc 101 108 pb3/tp3/tiocb3 nc 74 79 xtal nc 102 109 pb4/tp4/tioca4 nc 75 80 v cc v cc 103 110 pb5/tp5/tiocb4 nc 76 81 nmi a9 104 111 pb6/tp6/tocxa4/ tclkc nc 77 82 v cc v pp 105 112 pb7/tp7/tocxb4/ tclkd nc 78 83 wdtovf res irq4 irq5 90 nc nc 120 nc nc
17 section 2 cpu 2.1 register configuration the register set consists of sixteen 32-bit general registers, three 32-bit control registers, and four 32-bit system registers. 2.1.1 general registers (rn) general registers rn consist of sixteen 32-bit registers (r0?15). general registers are used for data processing and address calculation. register r0 also functions as an index register. for some instructions, the r0 register must be used. register r15 functions as a stack pointer to save or restore status registers (sr) and the program counter (pc) during exception handling. r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15, sp (hardware stack pointer) 0 31 r0 functions as an index register in the indexed register addressing mode and indirect indexed gbr addressing mode. in some instruc- tions, r0 functions as a source register or a destination register. r15 functions as a stack pointer (sp) during exception handling. figure 2.1 general registers (rn)
18 2.1.2 control registers control registers consist of the 32-bit status register (sr), global base register (gbr), and vector base register (vbr). the status register indicates processing states. the global base register functions as a base address for the indirect gbr addressing mode to transfer data to the registers of on-chip supporting modules. the vector base register functions as the base address of the exception vector area including interrupts. 9876543210 mqi3 i2 i1 i0 st 0 0 31 31 gbr vbr sr 31 s bit: used by the mac instruction. reserved bits. these bits always read 0. the write value should always be 0. bits i3?0: interrupt mask bits. m and q bits: used by the div0u, div0s, and div1 instructions. global base register (gbr): indicates the base address in indirect gbr addressing mode. the indirect gbr addressing mode is used to transfer data to the on-chip supporting module register area, etc. vector base register (vbr): stores the base address of the exception vector area. sr: status register t bit: the movt, cmp, tas, tst, bt, bf, sett, and clrt instructions use the t bit to indicate true (1) or false (0). the addv, addc, subv, subc, div0u, div0s, div1, negc, shar, shal, shlr, shll, rotr, rotl, rotcr and rotcl instructions also use the t bit to indicate carry/borrow or overflow/underflow figure 2.2 control registers
19 2.1.3 system registers system registers consist of four 32-bit registers: multiply and accumulate registers high and low (mach and macl), procedure register (pr), and program counter (pc). the multiply and accumulate registers store the results of multiply and accumulate operations. the procedure register stores the return address for a subroutine procedure. the program counter stores program addresses to control the flow of the processing. macl pr pc (sign extended) mach 31 9 0 0 0 31 31 multiply and accumulate (mac) registers high and low (mach, macl): store the results of multiply and accumulate opera- tions. mach is sign-extended when read because only the lowest 10 bits are valid. procedure register (pr): stores the return address for a subroutine procedure. program counter (pc): indicates the fourth byte (second instruction) after the current instruction. figure 2.3 system registers 2.1.4 initial values of registers table 2.1 lists the values of the registers after reset. table 2.1 initial values of registers classification register initial value general registers r0 r14 undefined r15 (sp) value of the stack pointer in the vector address table control registers sr bits i3 i0 are 1111(h'f), reserved bits are 0, and other bits are undefined gbr undefined vbr h'00000000 system registers mach, macl, pr undefined pc value of the program counter in the vector address table
20 2.2 data formats 2.2.1 data format in registers register operands are always longwords (32 bits). when the memory operand is only a byte (8 bits) or a word (16 bits), it is sign-extended into a longword when stored into a register (figure 2.4). 31 0 longword figure 2.4 data format in registers 2.2.2 data format in memory memory data formats are classified into bytes, words, and longwords. byte data can be accessed from any address, but an address error will occur if an attempt is made to access word data starting from an address other than 2n or longword data starting from an address other than 4n. in such cases, the data accessed cannot be guaranteed. the hardware stack area, which is referred to by the hardware stack pointer (sp, r15), uses only longword data starting from address 4n because this area stores the program counter and status register (figure 2.5). 31 0 70 15 0 31 0 7 7 15 7 23 7 byte 0 0 0 15 0 byte byte byte word word longword address 2n address 4n address m address m + 2 address m + 1 address m + 3 figure 2.5 data format in memory
21 2.2.3 immediate data format byte (8-bit) immediate data is located in the instruction code. immediate data accessed by the mov, add, and cmp/eq instructions is sign-extended and is handled in registers as longword data. immediate data accessed by the tst, and, or, and xor instructions is zero-extended and is handled as longword data. consequently, and instructions with immediate data always clear the upper 24 bits of the destination register. word or longword immediate data is not located in the instruction code but rather is stored in a memory table. the memory table is accessed by an immediate data transfer instruction (mov) using the pc relative addressing mode with displacement. 2.3 instruction features 2.3.1 risc-type instruction set all instructions are risc type. their features are as follows: 16-bit fixed length: every instruction is 16 bits long, making program coding much more efficient. one instruction/cycle: basic instructions can be executed in one cycle using a pipeline system. one-cycle instructions are executed in 50 ns at 20 mhz. data length: longword is the standard data length for all operations. memory can be accessed in bytes, words, or longwords. byte or word data accessed from memory is sign-extended and handled as longword data. immediate data is sign-extended for arithmetic operations or zero- extended for logic operations (handled as longword data). table 2.2 sign extension of word data sh7000 series cpu description conventional cpus mov.w @(disp,pc),r1 add r1,r0 ........... .data.w h'1234 data is sign-extended to 32 bits, and r1 becomes h'00001234. it is next operated upon by an add instruction. add.w #h'1234,r0 note: the address of the immediate data is accessed by @(disp, pc).
22 load-store architecture: basic operations are executed between registers. for operations that involve memory, data is loaded into to the registers and executed (load-store architecture). instructions such as and that manipulate bits, however, are executed directly in memory. delayed branch instructions: unconditional branch instructions are delayed. pipeline disruption during branching is reduced by first executing the instruction that follows the branch instruction, and then branching. see the sh-1/sh-2 programming manual for details. table 2.3 delayed branch instructions sh7000 series cpu description conventional cpu bra trget add r1,r0 executes an add before branching to trget. add.w r1,r0 bra trget multiplication/accumulation operation: the five-stage pipeline system and the on-chip multiplier enable 16-bit 16-bit 32-bit multiplication operations to be executed in 1? cycles. 16-bit 16-bit + 42-bit 42-bit multiplication/accumulation operations can be executed in 2? cycles. t bit: t bit (in the status register) is set according to the result of a comparison, and in turn is the condition (true/false) that determines if the program will branch. the t bit in the status register is only changed by selected instructions, thus improving the processing speed. table 2.4 t bit sh7000 series cpu description conventional cpu cmp/ge r1,r0 bt trget0 bf trget1 t bit is set when r0 r1. the program branches to trget0 when r0 r1 and to trget1 when r0 23 table 2.5 immediate data accessing classification sh7000 series cpu conventional cpu 8-bit immediate mov #h'12,r0 mov.b #h'12,r0 16-bit immediate mov.w @(disp,pc),r0 ......... .data.w h'1234 mov.w #h'1234,r0 32-bit immediate mov.l @(disp,pc),r0 ......... .data.l h'12345678 mov.l #h'12345678, r0 note: the address of the immediate data is accessed by @(disp, pc). absolute address: when data is accessed by absolute address, the value already in the absolute address is placed in the memory table. by loading the immediate data when the instruction is executed, that value is transferred to the register and the data is accessed in the indirect register addressing mode. table 2.6 absolute address accessing classification sh7000 series cpu conventional cpu absolute address mov.l @(disp,pc),r1 mov. b @r1,r0 ......... .data.l h'12345678 mov.b @h'12345678,r0 note: the address of the immediate data is accessed by @(disp, pc). 16/32-bit displacement: when data is accessed by 16-bit or 32-bit displacement, the pre-existing displacement value is placed in the memory table. by loading the immediate data when the instruction is executed, that value is transferred to the register and the data is accessed in the indirect indexed register addressing mode. table 2.7 accessing by displacement classification sh7000 series cpu conventional cpu 16-bit displacement mov.w @(disp,pc),r0 mov.w @(r0,r1),r2 ......... .data.w h'1234 mov.w @(h'1234,r1),r2 note: the address of the immediate data is accessed by @(disp, pc).
24 2.3.2 addressing modes addressing modes and effective address calculation are described in table 2.8. table 2.8 addressing modes and effective addresses addressing mode mnemonic expression effective addresses calculation equation direct register addressing rn the effective address is register rn. (the operand is the contents of register rn.) indirect register addressing @rn the effective address is the contents of register rn. rn rn rn post-incre- ment indirect register addressing @rn + the effective address is the contents of register rn. a constant is added to the contents of rn after the instruction is executed. 1 is added for a byte operation, 2 for a word operation, and 4 for a longword operation. rn rn 1/2/4 + rn + 1/2/4 rn (after the instruction is executed) byte: rn + 1 rn word: rn + 2 rn longword: rn + 4 rn pre-decre- ment indirect register addressing @ rn the effective address is the value obtained by subtracting a constant from rn. 1 is subtracted for a byte operation, 2 for a word operation, and 4 for a longword operation. rn 1/2/4 rn 1/2/4 rn 1/2/4 byte: rn 1 rn word: rn 2 rn longword: rn 4 rn (instruction executed with rn after calculation)
25 table 2.8 addressing modes and effective addresses (cont) addressing mode mnemonic expression effective addresses calculation equation indirect register addressing with displace- ment @(disp:4, rn) the effective address is rn plus a 4-bit displacement (disp). disp is zero-extended, and remains the same for a byte operation, is doubled for a word operation, and is quadrupled for a longword operation. rn rn + disp 1/2/4 + 1/2/4 disp (zero-extended) byte: rn + disp word: rn + disp 2 longword: rn + disp 4 indirect indexed register addressing @(r0, rn) rn r0 rn + r0 + rn + r0 indirect gbr addressing with displace- ment @(disp:8, gbr) the effective address is the gbr value plus an 8- bit displacement (disp). the value of disp is zero- extended, and remains the same for a byte operation, is doubled for a word operation, and is quadrupled for a longword operation. gbr 1/2/4 gbr + disp 1/2/4 + disp (zero-extended) byte: gbr + disp word: gbr + disp 2 longword: gbr + disp 4 indirect indexed gbr addressing @(r0, gbr) the effective address is the gbr value plus the r0 value. gbr r0 gbr + r0 + gbr + r0
26 table 2.8 addressing modes and effective addresses (cont) addressing mode mnemonic expression effective addresses calculation equation pc relative addressing with dis- placement @(disp:8, pc) the effective address is the pc value plus an 8-bit displacement (disp). disp is zero-extended, is doubled for a word operation, and is quadrupled for a longword operation. for a longword operation, the lowest two bits of the pc are masked. pc h'fffffffc pc + disp 2 or pc & h'fffffffc + disp 4 + 2/4 & * disp (zero-extended) * : for longword word: pc + disp 2 longword: pc & h'fffffffc + disp 4 pc relative addressing disp:8 the effective address is the pc value sign- extended with an 8-bit displacement (disp), doubled, and added to the pc. pc 2 + disp (zero-extended) pc + disp 2 pc + disp 2 disp:12 the effective address is the pc value sign- extended with a 12-bit displacement (disp), doubled, and added to the pc. pc 2 + disp (zero-extended) pc + disp 2 pc + disp 2
27 table 2.8 addressing modes and effective addresses (cont) addressing mode mnemonic expression effective addresses calculation equation immediate addressing #imm:8 the 8-bit immediate data (imm) for the tst, and, or, and xor instructions is zero-extended. #imm:8 the 8-bit immediate data (imm) for the mov, add, and cmp/eq instructions is sign-extended. #imm:8 immediate data (imm) for the trapa instruction is zero-extended and is quadrupled. 2.3.3 instruction formats the instruction format refers to the source operand and the destination operand. the meaning of the operand depends on the instruction code. symbols are as follows. xxxx instruction code mmmm source register nnnn destination register iiii immediate data dddd displacement
28 table 2.9 instruction formats instruction format source operand destination operand example 0 format xxxx xxxx xxxx xxxx 15 0 nop n format xxxx xxxx xxxx nnnn 15 0 nnnn : register direct movt rn control register or system register nnnn : register direct sts mach,rn control register or system register nnnn : register indirect with pre-decrement stc.l sr,@-rn m format xxxx mmmm xxxx xxxx 15 0 mmmm : register direct control register or system register ldc rm,sr mmmm : register indirect with post-increment control register or system register ldc.l @rm+,sr mmmm : register indirect jmp @rm
29 table 2.9 instruction formats (cont) instruction format source operand destination operand example nm format mmmm : register direct nnnn : register direct add rm,rn nnnn xxxx xxxx 15 0 mmmm mmmm : register direct nnnn : register indirect mov.l rm,@rn mmmm : register indirect with post- increment (multiply- and-accumulate) nnnn : register indirect with post- increment (multiply- and-accumulate) * mach, macl mac.w @rm+,@rn+ mmmm : register indirect with post-increment nnnn : register direct mov.l @rm+,rn mmmm : register direct nnnn : register indirect with pre-decrement mov.l rm,@-rn mmmm : register direct nnnn : indexed register indirect mov.l rm,@(r0,rn) md format xxxx dddd 15 0 mmmm xxxx mmmmdddd : register indirect with displacement r0 (register direct) mov.b @(disp,rn),r0 nd4 format xxxx xxxx dddd 15 0 nnnn r0 (register direct) nnnndddd : register indirect with displacement mov.b r0,@(disp,rn) nmd format nnnn xxxx dddd 15 0 mmmm mmmm : register direct nnnndddd : register indirect with displacement mov.l rm,@(disp,rn) mmmmdddd : register indirect with displacement nnnn : register direct mov.l @(disp,rm),rn
30 table 2.9 instruction formats (cont) instruction format source operand destination operand example d format dddd xxxx 15 0 xxxx dddd dddddddd : gbr indirect with displacement r0 (register direct) mov.l @(disp,gbr),r0 r0 (register direct) dddddddd : gbr indirect with displacement mov.l r0,@(disp,gbr) dddddddd : pc relative with displacement r0 (register direct) mova @(disp,pc),r0 dddddddd : pc relative bf label d12 format dddd xxxx 15 0 dddd dddd dddddddddddd : pc relative bra label (label = disp + pc) nd8 format dddd nnnn xxxx 15 0 dddd dddddddd : pc relative with displacement nnnn : register direct mov.l @(disp,pc),rn i format iiiiiiii: immediate indexed gbr indirect and.b #imm,@(r0,gbr) xxxx xxxx i i i i 15 0 i i i i iiiiiiii : immediate r0 (register direct) and #imm,r0 iiiiiiii: immediate trapa #imm ni format nnnn i i i i xxxx 15 0 i i i i iiiiiiii : immediate nnnn : register direct add #imm,rn note: * in multiply-and-accumulate instructions, nnnn is the source register.
31 2.4 instruction set 2.4.1 instruction set by classification table 2.10 lists instructions by classification. table 2.10 classification of instructions classifi- cation types operation code function number of instructions data transfer 5 mov data transfer, immediate data transfer, supporting module data transfer, structure data transfer 39 mova effective address transfer movt t bit transfer swap swap of upper and lower bytes xtrct extraction of the middle of registers connected arithmetic 17 add binary addition 28 operations addc binary addition with carry addv binary addition with overflow check cmp/cond comparison div1 division div0s initialization of signed division div0u initialization of unsigned division exts sign extension extu zero extension mac multiplication and accumulation muls signed multiplication mulu unsigned multiplication neg negation negc negation with borrow sub binary subtraction subc binary subtraction with carry subv binary subtraction with underflow check logic 6 and logical and 14 operations not bit inversion or logical or tas memory test and bit set
32 table 2.10 classification of instructions (cont) classifi- cation types operation code function number of instructions logic oper- 6 tst logical and and t bit set 14 ations (cont) xor exclusive or shift 10 rotl one-bit left rotation 14 rotr one-bit right rotation rotcl one-bit left rotation with t bit rotcr one-bit right rotation with t bit shal one-bit arithmetic left shift shar one-bit arithmetic right shift shll one-bit logical left shift shlln n-bit logical left shift shlr one-bit logical right shift shlrn n-bit logical right shift branch 7 bf conditional branch (t = 0) 7 bt conditional branch (t = 1) bra unconditional branch bsr branch to subroutine procedure jmp unconditional branch jsr branch to subroutine procedure rts return from subroutine procedure system 11 clrt t bit clear 31 control clrmac mac register clear ldc load to control register lds load to system register nop no operation rte return from exception handling sett t bit set sleep shift into power-down mode stc store control register data sts store system register data trapa trap exception handling total 56 133
33 the following tables (arranged by instruction classification) show instruction codes, operations, and execution states, using the format shown below. table 2.11 instruction code format item format explanation instruction mnemonic op.sz src,dest op: operation code sz: size src: source dest: destination rm: source register rn: destination register imm: immediate data disp: displacement * instruction code msb ? lsb mmmm: source register nnnn: destination register 0000: r0 0001: r1 ........... 1111: r15 iiii: immediate data dddd: displacement operation summary , (xx) m/q/t & | ^ ~ <>n direction of transfer memory operand flag bits in sr logical and of each bit logical or of each bit exclusive or of each bit logical not of each bit n-bit shift execution value when no wait states are inserted cycle instruction execution cycles: the execution cycles shown in the table are minimums. the actual number of cycles may be increased: 1. when contention occurs between instruction fetches and data access, or 2. when the destination register of the load instruction (memory register) and the register used by the next instruction are the same. t bit value of t bit after instruction is executed no change note: * the table shows the minimum number of execution states. in practice, the number of instruction execution states will be increased in cases such as the following: 1. when there is conflict between an instruction fetch and a data access 2. when the destination register of a load instruction (memory register) is also used by the following instruction
34 table 2.12 data transfer instructions instruction instruction code operation execu- tion cycles t bit mov #imm,rn 1110nnnniiiiiiii #imm sign extension rn 1 mov.w @(disp,pc),rn 1001nnnndddddddd (disp 2 + pc) sign extension rn 1 mov.l @(disp,pc),rn 1101nnnndddddddd (disp 4 + pc) rn 1 mov rm,rn 0110nnnnmmmm0011 rm rn 1 mov.b rm,@rn 0010nnnnmmmm0000 rm (rn) 1 mov.w rm,@rn 0010nnnnmmmm0001 rm (rn) 1 mov.l rm,@rn 0010nnnnmmmm0010 rm (rn) 1 mov.b @rm,rn 0110nnnnmmmm0000 (rm) sign extension rn 1 mov.w @rm,rn 0110nnnnmmmm0001 (rm) sign extension rn 1 mov.l @rm,rn 0110nnnnmmmm0010 (rm) rn 1 mov.b rm,@?n 0010nnnnmmmm0100 rn 1 rn, rm (rn) 1 mov.w rm,@?n 0010nnnnmmmm0101 rn 2 rn, rm (rn) 1 mov.l rm,@?n 0010nnnnmmmm0110 rn 4 rn, rm (rn) 1 mov.b @rm+,rn 0110nnnnmmmm0100 (rm) sign extension rn, rm + 1 rm 1 mov.w @rm+,rn 0110nnnnmmmm0101 (rm) sign extension rn, rm + 2 rm 1 mov.l @rm+,rn 0110nnnnmmmm0110 (rm) rn, rm + 4 rm 1 mov.b r0,@(disp,rn) 10000000nnnndddd r0 (disp + rn) 1 mov.w r0,@(disp,rn) 10000001nnnndddd r0 (disp 2 + rn) 1 mov.l rm,@(disp,rn) 0001nnnnmmmmdddd rm (disp 4 + rn) 1 mov.b @(disp,rm),r0 10000100mmmmdddd (disp + rm) sign extension r0 1 mov.w @(disp,rm),r0 10000101mmmmdddd (disp 2 + rm) sign extension r0 1 mov.l @(disp,rm),rn 0101nnnnmmmmdddd (disp 4 + rm) rn 1 mov.b rm,@(r0,rn) 0000nnnnmmmm0100 rm (r0 + rn) 1 mov.w rm,@(r0,rn) 0000nnnnmmmm0101 rm (r0 + rn) 1
35 table 2.12 data transfer instructions (cont) instruction instruction code operation execu- tion cycles t bit mov.l rm,@(r0,rn) 0000nnnnmmmm0110 rm (r0 + rn) 1 mov.b @(r0,rm),rn 0000nnnnmmmm1100 (r0 + rm) sign extension rn 1 mov.w @(r0,rm),rn 0000nnnnmmmm1101 (r0 + rm) sign extension rn 1 mov.l @(r0,rm),rn 0000nnnnmmmm1110 (r0 + rm) rn 1 mov.b r0,@(disp,gbr) 11000000dddddddd r0 (disp + gbr) 1 mov.w r0,@(disp,gbr) 11000001dddddddd r0 (disp 2 + gbr) 1 mov.l r0,@(disp,gbr) 11000010dddddddd r0 (disp 4 + gbr) 1 mov.b @(disp,gbr),r0 11000100dddddddd (disp + gbr) sign extension r0 1 mov.w @(disp,gbr),r0 11000101dddddddd (disp 2 + gbr) sign extension r0 1 mov.l @(disp,gbr),r0 11000110dddddddd (disp 4 + gbr) r0 1 mova @(disp,pc),r0 11000111dddddddd disp 4 + pc r0 1 movt rn 0000nnnn00101001 t rn 1 swap.b rm,rn 0110nnnnmmmm1000 rm swap the bottom two bytes rn 1 swap.w rm,rn 0110nnnnmmmm1001 rm swap two consecutive words rn 1 xtrct rm,rn 0010nnnnmmmm1101 rm: center 32 bits of rn rn 1
36 table 2.13 arithmetic instructions instruction instruction code operation execution cycles t bit add rm,rn 0011nnnnmmmm1100 rn + rm rn 1 add #imm,rn 0111nnnniiiiiiii rn + imm rn 1 addc rm,rn 0011nnnnmmmm1110 rn + rm + t rn, carry t 1 carry addv rm,rn 0011nnnnmmmm1111 rn + rm rn, overflow t 1 overflow cmp/eq #imm,r0 10001000iiiiiiii if r0 = imm, 1 t 1 comparison result cmp/eq rm,rn 0011nnnnmmmm0000 if rn = rm, 1 t 1 comparison result cmp/hs rm,rn 0011nnnnmmmm0010 if rn rm with unsigned data, 1 t 1 comparison result cmp/ge rm,rn 0011nnnnmmmm0011 if rn rm with signed data, 1 t 1 comparison result cmp/hi rm,rn 0011nnnnmmmm0110 if rn > rm with unsigned data, 1 t 1 comparison result cmp/gt rm,rn 0011nnnnmmmm0111 if rn > rm with signed data, 1 t 1 comparison result cmp/pz rn 0100nnnn00010001 if rn 0, 1 t 1 comparison result cmp/pl rn 0100nnnn00010101 if rn > 0, 1 t 1 comparison result cmp/str rm,rn 0010nnnnmmmm1100 if rn and rm have an equivalent byte, 1 t 1 comparison result div1 rm,rn 0011nnnnmmmm0100 single-step division (rn/rm) 1 calculation result div0s rm,rn 0010nnnnmmmm0111 msb of rn q, msb of rm m, m ^ q t 1 calculation result div0u 0000000000011001 0 m/q/t 1 0 exts.b rm,rn 0110nnnnmmmm1110 a byte in rm is sign- extended rn 1
37 table 2.13 arithmetic instructions (cont) instruction instruction code operation execution cycles t bit exts.w rm,rn 0110nnnnmmmm1111 a word in rm is sign- extended rn 1 extu.b rm,rn 0110nnnnmmmm1100 a byte in rm is zero- extended rn 1 extu.w rm,rn 0110nnnnmmmm1101 a word in rm is zero- extended rn 1 mac.w @rm +,@rn+ 0100nnnnmmmm1111 signed operation of (rn) (rm) + mac mac 3/(2) * muls rm,rn 0010nnnnmmmm1111 signed operation of rn rm mac 1 3 * mulu rm,rn 0010nnnnmmmm1110 unsigned operation of rn rm mac 1 3 * neg rm,rn 0110nnnnmmmm1011 0 rm rn 1 negc rm,rn 0110nnnnmmmm1010 0 rm t rn, borrow t 1 borrow sub rm,rn 0011nnnnmmmm1000 rn rm rn 1 subc rm,rn 0011nnnnmmmm1010 rn rm t rn, borrow t 1 borrow subv rm,rn 0011nnnnmmmm1011 rn rm rn, underflow t 1 underflow note: * the normal minimum number of cycles (numbers in parenthesis represent the number of cycles when there is contention with preceding or following instructions).
38 table 2.14 logic operation instructions instruction instruction code operation execution cycles t bit and rm,rn 0010nnnnmmmm1001 rn & rm rn 1 and #imm,r0 11001001iiiiiiii r0 & imm r0 1 and.b #imm,@(r0,gbr) 11001101iiiiiiii (r0 + gbr) & imm (r0 + gbr) 3 not rm,rn 0110nnnnmmmm0111 ~rm rn 1 or rm,rn 0010nnnnmmmm1011 rn | rm rn 1 or #imm,r0 11001011iiiiiiii r0 | imm r0 1 or.b #imm,@(r0,gbr) 11001111iiiiiiii (r0 + gbr) | imm (r0 + gbr) 3 tas.b @rn 0100nnnn00011011 if (rn) is 0, 1 t; 1 msb of (rn) 4 test result tst rm,rn 0010nnnnmmmm1000 rn & rm; if the result is 0, 1 t 1 test result tst #imm,r0 11001000iiiiiiii r0 & imm; if the result is 0, 1 t 1 test result tst.b #imm,@(r0,gbr) 11001100iiiiiiii (r0 + gbr) & imm; if the result is 0, 1 t 3 test result xor rm,rn 0010nnnnmmmm1010 rn ^ rm rn 1 xor #imm,r0 11001010iiiiiiii r0 ^ imm r0 1 xor.b #imm,@(r0,gbr) 11001110iiiiiiii (r0 + gbr) ^ imm (r0 + gbr) 3
39 table 2.15 shift instructions instruction instruction code operation execution cycles t bit rotl rn 0100nnnn00000100 t rn msb 1 msb rotr rn 0100nnnn00000101 lsb rn t 1 lsb rotcl rn 0100nnnn00100100 t rn t 1 msb rotcr rn 0100nnnn00100101 t rn t 1 lsb shal rn 0100nnnn00100000 t rn 0 1 msb shar rn 0100nnnn00100001 msb rn t 1 lsb shll rn 0100nnnn00000000 t rn 0 1 msb shlr rn 0100nnnn00000001 0 rn t 1 lsb shll2 rn 0100nnnn00001000 rn<<2 rn 1 shlr2 rn 0100nnnn00001001 rn>>2 rn 1 shll8 rn 0100nnnn00011000 rn<<8 rn 1 shlr8 rn 0100nnnn00011001 rn>>8 rn 1 shll16 rn 0100nnnn00101000 rn<<16 rn 1 shlr16 rn 0100nnnn00101001 rn>>16 rn 1 table 2.16 branch instructions instruction instruction code operation execution cycles t bit bf label 10001011dddddddd if t = 0, disp 2 + pc pc; if t = 1, nop 3/1 * bt label 10001001dddddddd if t = 1, disp 2 + pc pc; if t = 0, nop 3/1 * bra label 1010dddddddddddd delayed branch, disp 2 + pc pc 2 bsr label 1011dddddddddddd delayed branch, pc pr, disp 2 + pc pc 2 jmp @rm 0100mmmm00101011 delayed branch, rm pc 2 jsr @rm 0100mmmm00001011 delayed branch, pc pr, rm pc 2 rts 0000000000001011 delayed branch, pr pc 2 note: * the execution state is three cycles when program branches, and one cycle when program does not branch.
40 table 2.17 system control instructions instruction instruction code operation execution cycles t bit clrt 0000000000001000 0 t10 clrmac 0000000000101000 0 mach, macl 1 ldc rm,sr 0100mmmm00001110 rm sr 1 lsb ldc rm,gbr 0100mmmm00011110 rm gbr 1 ldc rm,vbr 0100mmmm00101110 rm vbr 1 ldc.l @rm+,sr 0100mmmm00000111 (rm) sr, rm + 4 rm 3 lsb ldc.l @rm+,gbr 0100mmmm00010111 (rm) gbr, rm + 4 rm 3 ldc.l @rm+,vbr 0100mmmm00100111 (rm) vbr, rm + 4 rm 3 lds rm,mach 0100mmmm00001010 rm mach 1 lds rm,macl 0100mmmm00011010 rm macl 1 lds rm,pr 0100mmmm00101010 rm pr 1 lds.l @rm+,mach 0100mmmm00000110 (rm) mach, rm + 4 rm 1 lds.l @rm+,macl 0100mmmm00010110 (rm) macl, rm + 4 rm 1 lds.l @rm+,pr 0100mmmm00100110 (rm) pr, rm + 4 rm 1 nop 0000000000001001 no operation 1 rte 0000000000101011 delayed branch, stack area pc/sr 4 sett 0000000000011000 1 t11 sleep 0000000000011011 sleep 3 * stc sr,rn 0000nnnn00000010 sr rn 1 stc gbr,rn 0000nnnn00010010 gbr rn 1 stc vbr,rn 0000nnnn00100010 vbr rn 1 stc.l sr,@?n 0100nnnn00000011 rn 4 rn, sr (rn) 2 stc.l gbr,@?n 0100nnnn00010011 rn 4 rn, gbr (rn) 2 stc.l vbr,@?n 0100nnnn00100011 rn 4 rn, vbr (rn) 2 sts mach,rn 0000nnnn00001010 mach rn 1 note: * the number of execution states before the chip enters the sleep state.
41 table 2.17 system control instructions (cont) instruction instruction code operation execution cycles t bit sts macl,rn 0000nnnn00011010 macl rn 1 sts pr,rn 0000nnnn00101010 pr rn 1 sts.l mach,@ rn 0100nnnn00000010 rn 4 rn, mach (rn) 1 sts.l macl,@ rn 0100nnnn00010010 rn 4 rn, macl (rn) 1 sts.l pr,@?n 0100nnnn00100010 rn 4 rn, pr (rn) 1 trapa #imm 11000011iiiiiiii pc/sr stack area, (imm 4 + vrr) pc 8 note: the execution cycles shown in the table are minimums. the actual number of cycles may be increased: 1. when contention occurs between instruction fetches and data access 2. when the destination register of the load instruction (memory register) and the register used by the next instruction are the same.
42 2.4.2 operation code map table 2.18 shows an operation code map. table 2.18 operation code map instruction code fx: 0000 fx: 0001 fx: 0010 fx: 0011?111 msb lsb md: 00 md: 01 md: 10 md: 11 0000 rn fx 0000 0000 rn fx 0001 0000 rn fx 0010 stc sr,rn stc gbr,rn stc vbr,rn 0000 rn fx 0011 0000 rn rm 01md mov.b rm, @(r0,rn) mov.w rm, @(r0,rn) mov.l rm, @(r0,rn) 0000 0000 fx 1000 clrt sett clrmac 0000 0000 fx 1001 nop divou 0000 0000 fx 1010 0000 0000 fx 1011 rts sleep rte 0000 rn fx 1000 0000 rn fx 1001 0000 rn fx 1010 sts mach,rn sts macl,rn sts pr,rn 0000 rn rm 1011 0000 rn rm 11md mov.b @(r0,rm),rn mov.w @(r0,rm),rn mov.l @(r0,rm),rn 0001 rn rm disp mov.l rm,@(disp:4,rn) 0010 rn rm 00md mov.b rm,@rn mov.w rm,@rn mov.l rm,@rn 0010 rn rm 01md mov.b rm,@-rn mov.w rm,@-rn mov.l rm,@-rn div0s rm,rn 0010 rn rm 10md tst rm,rn and rm,rn xor rm,rn or rm,rn 0010 rn rm 11md cmp/str rm,rn xtrct rm,rn mulu rm,rn muls rm,rn 0011 rn rm 00md cmp/eq rm,rn cmp/hs rm,rn cmp/ge rm,rn 0011 rn rm 01md div1 rm,rn cmp/hi rm,rn cmp/gt rm,rn 0011 rn rm 10md sub rm,rn subc rm,rn subv rm,rn 0011 rn rm 11md add rm,rn addc rm,rn addv rm,rn 0100 rn fx 0000 shll rn shal rn 0100 rn fx 0001 shlr rn cmp/pz rn shar rn 0100 rn fx 0010 sts.l mach, @?n sts.l macl, @?n sts.l pr, @?n
43 table 2.18 operation code map (cont) instruction code fx: 0000 fx: 0001 fx: 0010 fx: 0011?111 msb lsb md: 00 md: 01 md: 10 md: 11 0100 rn fx 0011 stc.l sr,@?n stc.l| gbr,@?n stc.l vbr,@?n 0100 rn fx 0100 rotl rn rotcl rn 0100 rn fx 0101 rotr rn cmp/pl rn rotcr rn 0100 rm fx 0110 lds.l @rm+,mach lds.l @rm+,macl lds.l @rm+,pr 0100 rm fx 0111 ldc.l @rm+,sr ldc.l @rm+,gbr ldc.l @rm+,vbr 0100 rn fx 1000 shll2 rn shll8 rn shll16 rn 0100 rn fx 1001 shlr2 rn shlr8 rn shll16 rn 0100 rm fx 1010 lds rm,mach lds rm,macl lds rm,pr 0100 rm/rn fx 1011 jsr @rm tas.b @rn jmp @rm 0100 rm fx 1100 0100 rm fx 1101 0100 rn fx 1110 ldc rm,sr ldc rm,gbr ldc rm,vbr 0100 rn rm 1111 mac.w @rm+,@rn+ 0101 rn rm disp mov.l @(disp:4,rm),rn 0110 rn rm 00md mov.b @rm,rn mov.w @rm,rn mov.l @rm,rn mov rm,rn 0110 rn rm 01md mov.b @rm+,rn mov.w @rm+,rn mov.l @rm+,rn not rm,rn 0110 rn rm 10md swap.b @rm,rn swap.w @rm,rn negc rm,rn neg rm,rn 0110 rn rm 11md extu.b rm,rn extu.w rm,rn exts.b rm,rn exts.w rm,rn 0111 rn imm add #imm:8,rn 1000 00md rn disp mov.b r0, @(disp:4,rn) mov.w r0, @(disp:4,rn) 1000 01md rm disp mov.b @(disp:4, rm),r0 mov.w @(disp:4, rm),r0 1000 10md imm/disp cmp/eq #imm:8,r0 bt disp:8 bf disp:8 1000 11md imm/disp 1001 rn disp mov.w @(disp:8,pc),rn 1010 disp bra disp:12 1011 disp bsr disp:12
44 table 2.18 operation code map (cont) instruction code fx: 0000 fx: 0001 fx: 0010 fx: 0011?111 msb lsb md: 00 md: 01 md: 10 md: 11 1100 00md imm/disp mov.b r0,@ (disp:8,gbr) mov.w r0,@ (disp:8,gbr) mov.l r0,@ (disp:8,gbr) trapa #imm:8 1100 01md disp mov.b @(disp:8, gbr),r0 mov.w @(disp:8, gbr),r0 mov.l @(disp:8, gbr),r0 mova @(disp:8, pc),r0 1100 10md imm tst #imm:8,r0 and #imm:8,r0 xor #imm:8,r0 or #imm:8,r0 1100 11md imm tst.b #imm:8, @(r0,gbr) and.b #imm:8, @(r0,gbr) xor.b #imm:8, @(r0,gbr) or.b #imm:8, @(r0,gbr) 1101 rn disp mov.l @(disp:8,pc),rn 1110 rn imm mov #imm:8,rn 1111 ...
45 2.5 cpu state 2.5.1 state transitions the cpu has five processing states: reset, exception handling, bus-released, program execution and power-down. the transitions between the states are shown in figure 2.6. for more information on the reset and exception handling states, see section 4, exception handling. for details on the power-down state, see section 19, power-down state.
46 res = 0, nmi = 1 res = 0, nmi = 0 power-on reset state manual reset state program execution state bus-release-state exception handling state res = 1, nmi = 0 res = 1, nmi = 1 when an interrupt source or dma address error occurs nmi interrupt source occurs exception handling ends bus request generated exception handling source occurs bus request cleared bus request generated bus request cleared sleep instruction with sby bit cleared sleep instruction with sby bit set from any state when res = 0 and nmi = 1 from any state when res = 0 and nmi = 0 reset states power-down state bus request generated bus request cleared standby mode sleep mode figure 2.6 transitions between processing states
47 reset state: in the reset state the cpu is reset. this occurs when the res exception handling state: exception handling is a transient state that occurs when the cpu s processing state flow is altered by exception handling sources such as resets or interrupts. in a reset, the initial values of the program counter pc (execution start address) and stack pointer sp are fetched from the exception vector table and stored; the cpu then branches to the execution start address and execution of the program begins. for an interrupt, the stack pointer (sp) is accessed and the program counter (pc) and status register (sr) are saved to the stack area. the exception handling routine start address is fetched from the exception vector table; the cpu then branches to that address and the program starts executing, thereby entering the program execution state. program execution state: in the program execution state, the cpu sequentially executes the program. power-down state: in the power-down state, cpu operation halts and power consumption decreases. the sleep instruction places the cpu in the power-down state. this state has two modes: sleep mode and standby mode. bus-released state: in the bus-released state, the cpu releases the bus to the device that has requested it.
48 2.5.2 power-down state in addition to the ordinary program execution states, the cpu also has a power-down state in which cpu operation halts and power consumption is reduced there are two power-down state modes: sleep mode and standby mode. sleep mode: when the standby bit sby (in the standby control register, sbycr) is cleared to 0 and a sleep instruction is executed, the cpu switches from program execution state to sleep mode. in sleep mode, the cpu halts and the contents of its internal registers and the data in on- chip ram are stored. the on-chip supporting modules other than the cpu do not halt in sleep mode. sleep mode is cleared by a reset, any interrupt, or a dma address error; the cpu returns to ordinary program execution state through the exception handling state. software standby mode: to enter standby mode, set standby bit sby (in the standby control register, sbycr) to 1 and execute a sleep instruction. in standby mode, all cpu, on-chip supporting module and oscillator functions are halted. cpu internal register contents and on-chip ram data are held. standby mode is cleared by a reset or an external nmi interrupt. for resets, the cpu returns to the ordinary program execution state through the exception handling state when placed in a reset state during the oscillator settling time. for nmi interrupts, the cpu returns to the ordinary program execution state through the exception handling state after the oscillator settling time has elapsed. in this mode, power consumption drops markedly, since the oscillator stops. table 2.19 power-down state state mode conditions clock cpu on-chip supporting modules cpu regi- sters ram i/o ports canceling sleep mode execute sleep instruction with sby bit cleared to 0 in sbycr run halted run held held held 1. interrupt 2. dma address error 3. power-on reset 4. manual reset standby mode execute sleep instruction with sby bit set to 1 in sbycr halted halted halted and initialized * held held held or high-z * (select- able) 1. nmi 2. power-on reset 3. manual reset note: * differs depending on the supporting module and pin.
49 section 3 operating modes 3.1 types of operating modes and their selection the sh7032 microcomputer operates in one of two operating modes (modes 0 and 1) and the sh7034 operates in one of four operating modes (modes 0, 1, 2, and 7). modes 0 and 1 differ in the bus width of memory area 0. the mode is selected by the mode pins (md2?d0) as indicated in table 3.1. do not change the mode selection while the chip is operating. table 3.1 operating mode selection pin settings operating mode md2 md1 md0 mode name bus width of area 0 mode 0 * 2 0 0 0 mcu mode 0 8 bits mode 1 * 2 0 0 1 mcu mode 1 16 bits mode 2 0 1 0 mcu mode 2 on-chip rom mode 7 * 1 1 1 1 prom mode notes: * 1 sh7034 prom version only * 2 only modes 0 and 1 are available in the sh7032 and sh7034 romless version. 3.2 operating mode descriptions 3.2.1 mode 0 (mcu mode 0) in mode 0, memory area 0 has an eight-bit bus width. for the memory map, see section 8, bus state controller (bsc). 3.2.2 mode 1 (mcu mode 1) in mode 1, memory area 0 has a 16-bit bus width. 3.2.3 mode 2 (mcu mode 2) in mode 2, memory area 0 is assigned to the on-chip rom. mode 2 should only be set for the product is the sh7034. 3.2.4 mode 7 (prom mode) mode 7 is a prom mode. in this mode, the prom can be programmed. for details, see section 17, rom. mode 7 should only be set for the sh7034 (prom version).
50
51 section 4 exception handling 4.1 overview 4.1.1 exception handling types and priorities as figure 4.1 indicates, exception handling may be caused by a reset, address error, interrupt, or instruction. exception sources are prioritized as indicated in figure 4.1. if two or more exceptions occur simultaneously, they are accepted and handled in the priority order shown.
52 reset priority high low exception source ?power-on reset ?manual reset address error interrupt ?cpu address error ?dma address error ?nmi ?user break ?irq ?on-chip module ?irq0?rq7 ?direct memory access controller ?16-bit integrated timer pulse unit ?serial communication interface ?parity control unit (part of the bus con- troller) ?a/d converter ?watchdog timer ?dram refresh control unit (part of the bus controller) instruction ?trap instruction ?illegal slot instruction ?general illegal instruction ?trapa instruction ?undefined instruction or instruction that rewrites the pc * 1 placed directly after a delayed branch instruction * 2 ?undefined code notes: * 1 the instructions that rewrite the pc are jmp, jsr, bra, bsr, rts, rte, bt, bf, and trapa. * 2 the delayed branch instructions are jmp, jsr. bra. bsr, rts, and rte. figure 4.1 exception source types and priority
53 4.1.2 exception handling operation exception sources are detected at the times indicated in table 4.1, whereupon handling starts. table 4.1 exception source detection and start of handling exception type source detection and start of handling reset power-on low-to-high transition at res pin when nmi is high manual low-to-high transition at res pin when nmi is low address error detected when instruction is decoded and starts after the instruction that was executing prior to this point is completed. interrupt detected when instruction is decoded and starts after the instruction that was executing prior to this point is completed. instruction trap instruction starts when a trap instruction (trapa) is executed. general illegal instruction starts when undefined code is decoded at a position other than directly after a delayed branch instruction (a delay slot). illegal slot instruction starts when undefined code or an instruction that rewrites the pc is decoded directly after a delayed branch instruction (in a delay slot). when exception handling begins, the cpu operates as follows: resets: the initial values of the program counter (pc) and stack pointer (sp) are read from the exception vector table (the respective pc and sp values are h'00000000 and h'00000004 for a power-on reset and h'00000008 and h'0000000c for a manual reset). for more information on the exception vector table, see section 4.1.3, exception vector table. next, the vector base register (vbr) is cleared to zero and interrupt mask bits (i3?0) in the status register (sr) are set to 1111. program execution starts from the pc address read from the exception vector table. address errors, interrupts and instructions: sr and pc are pushed onto the stack indicated in r15. for interrupts, the interrupt priority level is written in the interrupt mask bits (i3?0). for address errors and instructions, bits i3?0 are not affected. next, the start address is fetched from the exception vector table, and program execution starts from this address.
54 4.1.3 exception vector table before exception handling can execute, the exception vector table must be set in memory. the exception vector table holds the start addresses of exception handling routines (the table for reset exception handling stores initial pc and sp values). different vector numbers and vector table address offsets are assigned to different exception sources. the vector table addresses are calculated from the corresponding vector numbers and vector address offsets. in exception handling, the exception handling routine start address is fetched from the exception vector table indicated by this vector table address. table 4.2 lists vector numbers and vector table address offsets. table 4.3 shows how vector table addresses are calculated.
55 table 4.2 exception vector table exception source vector number vector table address offset power-on reset pc 0 h'00000000?'00000003 sp 1 h'00000004?'00000007 manual reset pc 2 h'00000008?'0000000b sp 3 h'0000000c?'0000000f general illegal instruction 4 h'00000010?'00000013 (reserved for system use) 5 h'00000014?'00000017 illegal slot instruction 6 h'00000018?'0000001b (reserved for system use) 7 h'0000001c?'0000001f 8 h'00000020?'00000023 cpu address error 9 h'00000024?'00000027 dma address error 10 h'00000028?'0000002b interrupts nmi 11 h'0000002c?'0000002f user break 12 h'00000030?'00000033 (reserved for system use) 13?1 h'00000034?'00000037 to h'0000007c?'0000007f trap instruction (user vectors) 32?3 h'00000080?'00000083 to h'000000fc?'000000ff interrupts irq0 64 h'00000100?'00000103 irq1 65 h'00000104?'00000107 irq2 66 h'00000108?'0000010b irq3 67 h'0000010c?'0000010f irq4 68 h'00000110?'00000113 irq5 69 h'00000114?'00000117 irq6 70 h'00000118?'0000011b irq7 71 h'0000011c?'0000011f on-chip modules * 72?55 h'00000120?'00000123 to h'000003fc?'000003ff note: * see table 5.3, interrupt exception vectors and rankings, in section 5, interrupt controller (intc), for details on vector numbers and vector table address offsets of individual on-chip supporting module interrupts.
56 table 4.3 calculation of exception vector table addresses exception source calculation of vector table address reset (vector table address) = (vector table address offset) = (vector number) 4 address error, interrupt, instructions (vector table address) = vbr + (vector table address offset) = vbr + (vector number) 4 note: vbr: vector base register. for vector table address offsets and vector numbers, see table 4.2. 4.2 resets 4.2.1 reset types a reset is the highest-priority exception. there are two types of reset: power-on reset and manual reset. as table 4.4 shows, a power-on reset initializes the internal state of the cpu and all registers of the on-chip supporting modules. a manual reset initializes the internal state of the cpu and all registers of the on-chip supporting modules except the bus state controller (bsc), pin function controller (pfc), and i/o ports (i/o). table 4.4 reset types transition conditions internal state reset nmi res cpu on-chip supporting modules power-on reset high low initialized initialized manual reset low low initialized all initialized except bsc, pfc, and i/o
57 4.2.2 power-on reset when the nmi pin is high, a low input at the res pin drives the chip into the power-on reset state. the res pin should be driven low while the clock pulse generator (cpg) is stopped (or while the cpg is operating during the oscillation settling time) for at least 20 t cyc to assure that the chip is reset. a power-on reset initializes the internal state of the cpu and all registers of the on-chip supporting modules. for pin states in the power-on reset state, see appendix b, pin states. while the nmi pin remains high, if the res pin is held low for a certain time then driven high in the power-on state, power-on reset exception handling begins. the cpu then: 1. reads the start address (initial pc value) from the exception vector table. 2. reads the initial stack pointer value (sp) from the exception vector table. 3. clears the vector base register (vbr) to h'00000000, and sets interrupt mask bits i3?0 in the status register (sr) to h'f (1111). 4. loads the values read from the exception vector table into the pc and sp and starts program execution. a power-on reset must be executed when turning on power. 4.2.3 manual reset when the nmi pin is high, a low input at the res pin drives the chip into the manual reset state. to ensure that the chip is properly reset, drive the res pin low for at least 20 t cyc . a manual reset initializes the internal state of the cpu and all registers of the on-chip supporting modules except the bus state controller, pin function controller, and i/o ports. since a manual reset does not affect the bus state controller, the dram refresh control function operates even if the manual reset state continues for a long time. when a manual reset is performed during the bus cycle, manual reset exception handling is deferred until the end of the bus cycle. the manual reset thus cannot be used to abort the bus cycle. for the pin states during the manual reset state, see appendix b, pin states. while the nmi pin remains low, if the res pin is held low for a certain time then driven high in the manual reset state, manual reset exception handling begins. the cpu carries out the same operations as for a power-on reset.
58 4.3 address errors 4.3.1 address error sources address errors occur during instruction fetches and data reading/writing as shown in table 4.5. table 4.5 address error sources bus cycle type bus master operation address error instruction fetch cpu instruction fetch from even address none (normal) instruction fetch from odd address address error instruction fetch from outside on-chip supporting module space none (normal) instruction fetch from on-chip supporting module space address error data read/write cpu or dmac access to word data from even address none (normal) access to word data from odd address address error access to longword data aligned on longword boundary none (normal) access to longword data not aligned on longword boundary address error access to word or byte data in on-chip supporting module space * none (normal) access to longword data in 16-bit on- chip supporting module space * none (normal) access to longword data in 8-bit on-chip supporting module space * address error note: * see section 8, bus state controller (bsc), for details on the on-chip supporting module space. 4.3.2 address error exception handling when an address error occurs, address error exception handling starts after both the bus cycle that caused the address error and the instructions that were being executed at that time, have been completed. the cpu then: 1. pushes sr onto the stack. 2. pushes the program counter onto the stack. the pc value saved is the start address of the instruction following the last instruction to be executed. 3. fetches the exception handling routine start address from the exception vector table for the address error that occurred and starts program execution from that address. the branch that occurs here is not a delayed branch.
59 4.4 interrupts 4.4.1 interrupt sources table 4.6 lists the types of interrupt exception handling sources (nmi, user break, irq, on-chip supporting module). table 4.6 interrupt sources interrupt requesting pin or module number of sources nmi nmi pin (external input) 1 user break user break controller 1 irq irq0 irq7 pin (external input) 8 on-chip supporting direct memory access controller 4 module 16-bit integrated timer pulse unit 15 serial communication interface 8 a/d converter 1 watchdog timer 1 bus state controller 2 each interrupt source has a different vector number and vector address offset value. see table 5.3, interrupt exception vectors and rankings, in section 5, interrupt controller (intc), for details on vector numbers and vector table address offsets. 4.4.2 interrupt priority rankings interrupt sources are assigned priorities. when multiple interrupts occur at the same time, the interrupt controller (intc) ascertains their priorities and starts exception handling based on its findings. priorities from 16? can be assigned, with 0 the lowest level and 16 the highest. nmi has priority level 16 and cannot be masked. nmi is always accepted. the user break priority level is 15. the irq and on-chip supporting module interrupt priority levels can be set in interrupt priority level registers a? (ipra?pre) as shown in table 4.7. priority levels 0?5 can be set. see section 5.3.1, interrupt priority registers a-e (ipra?pre), for details.
60 table 4.7 interrupt priority rankings type priority comments nmi 16 fixed and unmaskable user break 15 fixed irq and on-chip supporting modules 0?5 set in interrupt priority level registers a? (ipra?pre) 4.4.3 interrupt exception handling when an interrupt is generated, the intc ascertains the interrupt ranking. nmi is always accepted, but other interrupts are only accepted if their ranking is higher than the ranking set in the interrupt mask bits (i3?0) of sr. when an interrupt is accepted, interrupt exception handling begins. in the interrupt exception handling sequence, the sr and pc values are pushed onto the stack, and the priority level of the accepted interrupt is copied to the interrupt mask level bits (i3?0) in sr. in nmi exception handling, the priority ranking is 16 but the value 15 (h'f) is stored in i3?0. the exception handling routine start address for the accepted interrupt is fetched from the exception vector table and the program branches to that address and starts executing. for further information on interrupts, see section 5.4, interrupt operation.
61 4.5 instruction exceptions 4.5.1 types of instruction exceptions table 4.8 shows the three types of instruction that start exception handling (trap instructions, illegal slot instructions, and general illegal instructions). table 4.8 types of instruction exceptions type source instruction comments trap instruction trapa illegal slot instruction undefined code or instruction that rewrites the pc located immediately after a delayed branch instruction (delay slot) delayed branch instructions are: jmp, jsr, bra, bsr, rts, rte. instructions that rewrite the pc are: jmp, jsr, bra, bsr, rts, rte, bt, bf, and trapa general illegal instructions undefined code in other than delay slot 4.5.2 trap instruction trap instruction exception handling is carried out when a trap instruction (trapa) is executed. the cpu then: 1. saves the status register by pushing register contents onto the stack. 2. pushes the program counter value onto the stack. the pc value saved is the start address of the next instruction after the trapa instruction. 3. reads the exception handling routine start address from the vector table corresponding to the vector number specified in the trapa instruction, branches to that address, and starts program execution. the branch is not a delayed branch.
62 4.5.3 illegal slot instruction an instruction located immediately after a delayed branch instruction is called an ?nstruction placed in a delay slot.?if an undefined instruction is located in a delay slot, illegal slot instruction exception handling begins executing when the undefined code is decoded. illegal slot instruction exception handling also begins when the instruction located in the delay slot is an instruction that rewrites the program counter. in this case, exception handling begins when the instruction that rewrites the pc is decoded. the cpu performs illegal slot exception handling as follows: 1. saves the status register onto the stack. 2. pushes the program counter value onto the stack. the pc value saved is the branch destination address of the delayed branch instruction immediately before the instruction that contains the undefined code or rewrites the pc. 3. fetches the exception handling routine start address from the vector table corresponding to the exception that occurred, branches to that address, and starts executing the program. the branch is not a delayed branch. 4.5.4 general illegal instructions if an undefined instruction located other than in a delay slot (immediately after a delayed branch instruction) is decoded, general illegal instruction exception handling is executed. the cpu follows the same procedure as for illegal slot exception handling, except that the program counter (pc) value pushed on the stack in general illegal instruction exception handling is the start address of the illegal instruction with the undefined code.
63 4.6 cases in which exceptions are not accepted in some cases, address errors and interrupts that directly follow a delayed branch instruction or interrupt-disabled instruction are not accepted immediately. table 4.9 lists these cases. when this occurs, the exception is accepted when an instruction that can accept the exception is decoded. table 4.9 cases in which exceptions are not accepted exception source case address error interrupt immediately after delayed branch instruction * 1 xx immediately after interrupt-disabled instruction * 2 ox x: not accepted o: accepted notes: * 1 delayed branch instructions: jmp, jsr, bra, bsr, rts, rte * 2 interrupt-disabled instructions: ldc, ldc.l, stc, stc.l, lds, lds.l, sts, sts.l 4.6.1 immediately after delayed branch instruction address errors and interrupts are not accepted when an instruction in a delay slot immediately following a delayed branch instruction is decoded. the delayed branch instruction and the instruction in the delay slot are therefore always executed one after the other. exception handling is never inserted between them. 4.6.2 immediately after interrupt-disabling instruction interrupts are not accepted when the instruction immediately following an interrupt-disabled instruction is decoded. address errors are accepted, however.
64 4.7 stack status after exception handling table 4.10 shows the stack after exception handling. table 4.10 stack after exception handling type stack status type stack status address error upper 16 bits lower 16 bits upper 16 bits lower 16 bits sr address of instruction after instruc- tion that has finished executing sp interrupt upper 16 bits lower 16 bits upper 16 bits lower 16 bits sr address of instruction after instruc- tion that has finished executing sp trap instruc- tion upper 16 bits lower 16 bits upper 16 bits lower 16 bits sr address of instruction after trapa instruction sp illegal slot instruc- tion upper 16 bits lower 16 bits upper 16 bits lower 16 bits sr branch destination address of delayed branch instuction sp general illegal instruc- tion upper 16 bits lower 16 bits upper 16 bits lower 16 bits sr start add- ress of illegal instruction sp note: stack status is based on a bus width of 16 bits.
65 4.8 notes 4.8.1 value of the stack pointer (sp) an address error occurs if the stack is accessed for exception handling when the value of the stack pointer (sp) is not a multiple of four. therefore, a multiple of four should always be stored in the sp. 4.8.2 value of the vector base register (vbr) an address error occurs if the vector table is accessed for exception handling when the value of the vector base register (vbr) is not a multiple of four. therefore, vbr should always be set to a multiple of four. 4.8.3 address errors caused by stacking during address error exception handling if the stack pointer is not a multiple of four, address errors will occur in the exception handling (interrupt, etc.) stacking. after the exception handling ends, the cpu will then shift to address error exception handling. an address error will also occur during the address error exception handling stacking, but the cpu is set up to ignore the address error so that it can avoid an infinite series of address errors. this allows it to shift program control to the address error exception handling routine and handle the error. when an address error does occur in exception handling stacking, the stacking bus cycle (write) is executed. in sr and pc stacking, four is subtracted from each of the sps so the sp values are not multiples of four after stacking either. since the address value output during stacking is the sp value, the address that produced the error is exactly what is output. in such cases, the stacked write data will be undefined.
66
67 section 5 interrupt controller (intc) 5.1 overview the interrupt controller (intc) determines the priority of interrupt sources and controls interrupt requests to the cpu. intc has registers for assigning priority levels to interrupt sources. these registers handle interrupt requests according to user-specified priorities. 5.1.1 features the interrupt controller has the following features: ? 16 settable priority levels: five interrupt priority registers can set 16 levels of interrupt priorities for irq and on-chip supporting module interrupt sources. ? nmi noise canceller function: intc has an nmi input level bit that indicates the nmi pin status. by reading this bit in the interrupt exception handling routine, the pin status can be checked for use in a noise canceller function. ? the interrupt controller can notify external devices (via the irqout pin) that an on-chip interrupt has occurred. in this way an external device can, for example, be informed if an on- chip interrupt occurs while the chip is operating in bus-released mode and the bus has been requested. 5.1.2 block diagram figure 5.1 shows a block diagram of the interrupt controller.
68 cpu sr interrupt request com- parator priority decision logic input control (interrupt request) (interrupt request) (interrupt request) (interrupt request) (interrupt request) (interrupt request) (interrupt request) (interrupt request) icr ipr ipra?pre module bus bus interface internal bus i3 i2 i1 i0 intc irqout nmi irq0 irq1 irq2 irq3 irq4 irq5 irq6 irq7 ubc dmac itu sci prt a/d wdt ref ubc: user break controller wdt: watchdog timer dmac: direct memory access controller ref: dram refresh control unit of bsc itu: 16-bit integrated timer pulse unit icr: interrupt control register sci: serial communication interface ipra?pre: interrupt priority registers a? prt: parity control unit of bsc sr: status register a/d: a/d converter figure 5.1 block diagram of interrupt controller
69 5.1.3 pin configuration intc pins are summarized in table 5.1. table 5.1 intc pin configuration name abbr. i/o function nonmaskable interrupt input pin nmi i inputs a non-maskable interrupt request signal. interrupt request input pins irq0 irq7 i inputs maskable interrupt request signals. interrupt request output pin irqout o outputs a signal indicating an interrupt source has occurred. 5.1.4 registers the interrupt controller has six registers as listed in table 5.2. these registers are used for setting interrupt priority levels and controlling the detection of external interrupt input signals. table 5.2 interrupt controller register configuration name abbr. r/w address * 2 initial value bus width interrupt priority register a ipra r/w h'5ffff84 h'0000 8, 16, 32 interrupt priority register b iprb r/w h'5ffff86 h'0000 8, 16, 32 interrupt priority register c iprc r/w h'5ffff88 h'0000 8, 16, 32 interrupt priority register d iprd r/w h'5ffff8a h'0000 8, 16, 32 interrupt priority register e ipre r/w h'5ffff8c h'0000 8, 16, 32 interrupt control register icr r/w h'5ffff8e * 1 8, 16, 32 notes: * 1 h'8000 when pin nmi is high, h'0000 when pin nmi is low. * 2 only the values of bits a27?24 and a8?0 are valid; bits a23?9 are ignored. for details on the register addresses, see section 8.3.5, area descriptions.
70 5.2 interrupt sources there are four types of interrupt sources: nmi, user break, irq, and on-chip supporting module interrupts. interrupt rankings are expressed as priority levels (0?6), with 0 the lowest and 16 the highest. an interrupt set to level 0 is masked. 5.2.1 nmi interrupts nmi is the highest-priority interrupt (level 16) and is always accepted. input at the nmi pin is edge-sensed. either the rising or falling edge can be selected by setting the nmi edge select bit (nmie) in the interrupt control register (icr). nmi interrupt exception handling sets the interrupt mask level bits (i3?0) in the status register (sr) to level 15. 5.2.2 user break interrupt a user break interrupt occurs when a break condition is satisfied in the user break controller (ubc). a user break interrupt has priority level 15. user break interrupt exception handling sets the interrupt mask level bits (i3?0) in the status register (sr) to level 15. for further details on the user break interrupt, see section 6, user break controller (ubc). 5.2.3 irq interrupts irq interrupts are requested by input from pins irq0 irq7 . irq sense select bits 0? (irq0s irq7s) in the interrupt control register (icr) can select low-level sensing or falling-edge sensing for each pin independently. interrupt priority registers a and b (ipra and iprb) can select priority levels from 0?5 for each pin. irq interrupt exception handling sets the interrupt mask level bits (i3?0) in the status register (sr) to the priority level value of the irq interrupt that was accepted.
71 5.2.4 on-chip interrupts on-chip interrupts are interrupts generated by the following 6 on-chip supporting modules: ? direct memory access controller (dmac) ? 16-bit integrated timer pulse unit (itu) ? serial communication interface (sci) ? bus state controller (bsc) ? a/d converter (a/d) ? watchdog timer (wdt) a different interrupt vector is assigned to each interrupt source, so the exception handling routine does not have to decide which interrupt has occurred. priority levels 0?5 can be assigned to individual on-chip supporting module in interrupt priority registers c? (iprc?pre). on-chip interrupt exception handling sets the interrupt mask level bits (i3?0) in the status register (sr) to the priority level value of the on-chip interrupt that was accepted. 5.2.5 interrupt exception vectors and priority rankings table 5.3 lists the vector numbers, vector table address offsets, and interrupt priority order of the interrupt sources. each interrupt source is allocated a different vector number and vector table address offset. the vector table address is calculated from this vector number and address offset. in interrupt exception handling, the exception handling routine start address is fetched from the vector table indicated by this vector table address. see table 4.3, calculation of exception vector table address, in section 4, exception handling, for details on this calculation. arbitrary interrupt priority levels between 0 and 15 can be assigned to irq and on-chip supporting module interrupt sources by setting interrupt priority registers a? (ipra?pre) for each pin or module. the interrupt sources for iprc?pre, however, must be ranked in the order listed under priority within module in table 5.3 and cannot be changed. a reset assigns priority level 0 to irq and on-chip supporting module interrupts. if the same priority level is assigned to two or more interrupt sources, and interrupts from those sources occur simultaneously, their priority order is the default priority order indicated at the right in table 5.3.
72 table 5.3 interrupt exception vectors and rankings interrupt source interrupt pri- ority order (initial value) ipr (bit numbers) priority within module vec- tor no. address offset in vector table default priority order nmi 16 11 h'0000002c?'0000002f high user break 15 12 h'00000030?'00000033 irq0 0?5 (0) ipra (15?2) 64 h'00000100?'00000103 irq1 0?5 (0) ipra (11?) 65 h'00000104?'00000107 irq2 0?5 (0) ipra (7?) 66 h'00000108?'0000010b irq3 0?5 (0) ipra (3?) 67 h'0000010c?'0000010f irq4 0?5 (0) iprb (15?2) 68 h'00000110?'00000113 irq5 0?5 (0) iprb (11?) 69 h'00000114?'00000117 irq6 0?5 (0) iprb (7?) 70 h'00000118?'0000011b irq7 0?5 (0) iprb (3?) 71 h'0000011c?'0000011f dmac0 dei0 0?5 (0) iprc (15?2) 3 72 h'00000120?'00000123 reserved 2 73 h'00000124?'00000127 dmac1 dei1 1 74 h'00000128?'0000012b reserved 0 75 h'0000012c?'0000012f dmac2 dei2 0?5 (0) iprc (11?) 3 76 h'00000130?'00000133 reserved 2 77 h'00000134?'00000137 dmac3 dei3 1 78 h'00000138?'0000013b reserved 0 79 h'0000013c?'0000013f itu0 imia0 0?5 (0) iprc (7?) 3 80 h'00000140?'00000143 imib0 2 81 h'00000144?'00000147 ovi0 1 82 h'00000148?'0000014b reserved 0 83 h'0000014c?'0000014f itu1 imia1 0?5 (0) iprc (3?) 3 84 h'00000150?'00000153 imib1 2 85 h'00000154?'00000157 ovi1 1 86 h'00000158?'0000015b reserved 0 87 h'0000015c?'0000015f itu2 imia2 0?5 (0) iprd (15?2) 3 88 h'00000160?'00000163 imib2 2 89 h'00000164?'00000167 ovi2 1 90 h'00000168?'0000016b reserved 0 91 h'0000016c?'0000016f
73 table 5.3 interrupt exception vectors and rankings (cont) interrupt source interrupt pri- ority order (initial value) ipr (bit numbers) priority within module vec- tor no. address offset in vector table default priority order itu3 imia3 0?5 (0) iprd (11?) 3 92 h'00000170?'00000173 imib3 2 93 h'00000174?'00000177 ovi3 1 94 h'00000178?'0000017b reserved 0 95 h'0000017c?'0000017f itu4 imia4 0?5 (0) iprd (7?) 3 96 h'00000180?'00000183 imib4 2 97 h'00000184?'00000187 ovi4 1 98 h'00000188?'0000018b reserved 0 99 h'0000018c?'0000018f sci0 eri0 0?5 (0) iprd (3?) 3 100 h'00000190?'00000193 rxi0 2 101 h'00000194?'00000197 txi0 1 102 h'00000198?'0000019b tei0 0 103 h'0000019c?'0000019f sci1 eri1 0?5 (0) i pre (15?2) 3 104 h'000001a0?'000001a3 rxi1 2 105 h'000001a4?'000001a7 txi1 1 106 h'000001a8?'000001ab tei1 0 107 h' 000001ach' 000001af prt * 1 pei 0?5 (0) ipre (11?) 3 108 h'000001b0?'000001b3 a/d iti 2 109 h'000001b4?'000001b7 reserved 1 110 h'000001b8?'000001bb reserved 0 111 h'000001bc?'000001bf wdt iti 0?5 (0) ipre (7?) 3 112 h'000001c0?'000001c3 ref * 2 cmi 2 113 h'000001c4?'000001c7 reserved 1 114 h' 000001c8?' 000001cb reserved 0 115 h' 000001cch' 000001cf reserved 116 to 255 h' 000001d0?' 000001d3 t o h' 000003fch' 000003ff low notes: * 1 prt: parity control unit of bus state controller. * 2 ref: dram refresh control unit of bus state controller.
74 5.3 register descriptions 5.3.1 interrupt priority registers a? (ipra?pre) the five registers ipra?pre are 16-bit read/write registers that assign priority levels from 0?5 to the irq and on-chip supporting module interrupt sources. interrupt request sources are mapped onto ipra?pre as shown in table 5.4. bit: 15 14 13 12 11 10 9 8 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w table 5.4 interrupt request sources and ipra-ipre register bits 15?2 bits 11? bits 7? bits 3? ipra irq0 irq1 irq2 irq3 iprb irq4 irq5 irq6 irq7 iprc dmac0, dmac1 dmac2, dmac3 itu0 itu1 iprd itu2 itu3 itu4 sci0 ipre sci1 prt * 1 , a/d wdt, ref * 2 (reserved) * 3 notes: * 1 prt: parity control unit of bus state controller. see section 8, bus state controller (bsc), for details. * 2 ref: dram refresh control unit of bus controller. see section 8, bus state controller (bsc), for details. * 3 always read as 0. always write 0 in reserved bits. as indicated in table 5.4, four irq pins or four groups of on-chip supporting modules are assigned to each interrupt priority register. the priority levels for the four pins or groups can be set by setting the corresponding 4-bit groups of bits 15?2, bits 11?, bits 7?, and bits 3? (of ipra ipre) with values in the range of h'0 (0000) to h'f (1111). setting h'0 gives interrupt priority level 0 (the lowest). setting h'f gives level 15 (the highest). when two on-chip supporting modules are assigned to the same bits (dmac0 and dmac1, or dmac2 and dmac3, or the parity control unit and the a/d converter, or the watchdog timer and dram refresh control unit), those two modules have the same priority. a reset initializes ipra?pre to h'0000. these registers are not initialized in standby mode.
75 5.3.2 interrupt control register (icr) icr is a 16-bit register that sets the input detection mode of external interrupt input pins nmi and irq0 irq7 , and indicates the input signal level at the nmi pin. a reset initializes icr but standby mode does not. bit: 15 14 13 12 11 10 9 8 bit name: nmil nmie initial value: * 00 00 0 00 r/w: r r/w bit: 7 6 5 4 3 2 1 0 bit name: irq0s irq1s irq2s irq3s irq4s irq5s irq6s irq7s initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w note: * when nmi input is high: 1; when nmi input is low: 0 ? bit 15 (nmi input level (nmil)): nmil sets the level of the signal input at the nmi pin. nmil cannot be modified. the nmi input level can be read to determine the nmi pin level. bit 15: nmil description 0 nmi input level is low 1 nmi input level is high ? bits 14? (reserved): these bits are always read as 0. the write value should always be 0. ? bit 8 (nmi edge select (nmie)): nmie selects whether the falling or rising edge of the interrupt request signal at the nmi pin is sensed. bit 8: nmie description 0 interrupt is requested on falling edge of nmi input (initial value) 1 interrupt is requested on rising edge of nmi input ? bits 7? (irq0?rq7 sense select (irq0s?rq7s)): irq0?rq7 select whether the falling edge or low level of the irq inputs is sensed at pins irq0 irq7 . bits 7?: irq0s?rq7s description 0 interrupt is requested when irq input is low (initial value) 1 interrupt is requested on falling edge of irq input
76 5.4 interrupt operation 5.4.1 interrupt sequence the sequence of interrupt operations is described below. figure 5.2 shows a flowchart of the operations up to acceptance of the interrupt. 1. the interrupt request sources send interrupt request signals to the interrupt controller. 2. the interrupt controller selects the highest-priority interrupt among the interrupt requests sent, following the priority order indicated in table 5.3 and the levels set in interrupt priority registers a? (ipra?pre). lower priority interrupts are ignored * . if two interrupts with the same priority level are requested simultaneously, or if there are multiple interrupts occurring within a single module, the interrupt with the highest default priority or priority within module as indicated in table 5.3 is selected. 3. the interrupt controller compares the priority level of the selected interrupt request with the interrupt mask level bits (i3?0) in the cpu? status register (sr). if the request priority level is equal to or less than the interrupt mask level, the request is ignored. if the request priority level is higher than the interrupt mask level, the interrupt controller accepts the request and sends an interrupt request signal to the cpu. 4. when the interrupt controller accepts an interrupt request, it drives irqout pin low. 5. the cpu detects the interrupt request sent from the interrupt controller when it decodes the next instruction to be executed. instead of executing that instruction, the cpu starts interrupt exception handling. (see figure 5.4.) 6. in interrupt exception handling, first sr and pc are pushed onto the stack. 7. the priority level of the accepted interrupt is copied to the interrupt mask level bits (i3?0) in the status register (sr). 8. when the accepted interrupt is level-sensed or from an on-chip supporting module, the irqout pin returns to the high level. if the accepted interrupt is edge-sensed, the irqout pin returns to the high level when the instruction to be executed by the cpu in (5) is replaced by the interrupt exception handling. if the interrupt controller has accepted another interrupt (of a level higher than the current interrupt), however, the irqout pin remains low. 9. the cpu accesses the exception vector table at the entry for the vector number of the accepted interrupt, reads the start address of the exception handling routine, branches to that address, and starts executing the program there. this branch is not delayed. note: * a request for an external interrupt (irq) designated as edge-detected is held pending once only. an external interrupt designated as level-detected is held pending as long as the interrupt request continues, but if the request is cleared before the cpu next accepts an interrupt, the interrupt request is regarded as not having been made. interrupt requests from on-chip supporting modules are level requests. when the status flag in a particular module is set, an interrupt is requested. for details, see the descriptions of the individual modules. note that the interrupt request will be continued unless an operation described in "clearing conditions" is performed.
77 no yes nmi? no yes user break? no yes level 15 interrupt? no yes i3 to i0 irqout irqout irqout irqout s status register. * 2 if the accepted interrupt is edge-sensed, the irqout irqout figure 5.2 flowchart of interrupt operation
78 5.4.2 stack after interrupt exception handling figure 5.3 shows the stack after interrupt exception handling. upper 16 bits lower 16 bits upper 16 bits lower 16 bits sr pc * 1 address 4n 8 4n 6 4n 4 4n 2 4n sp * 2 notes: bus width is 16 bits. * 1 pc stores the start address of the next instruction (return instruction) after the executed instruction. * 2 the value of sp must always be a multiple of four. figure 5.3 stack after interrupt exception handling
79 5.5 interrupt response time table 5.5 shows the interrupt response time, which is the time from the occurrence of an interrupt request until interrupt exception handling starts and fetching of the first instruction of the interrupt handling routine begins. figure 5.4 shows the pipeline when an irq interrupt is accepted. table 5.5 interrupt response time number of states item nmi or on-chip interrupt irq notes interrupt priority decision and comparison with sr mask bit 23 wait for completion of sequence currently being executed by cpu x ( 0.55 0.95 m4 are the number of states needed for the following memory accesses: m1: sr save cycle (longword write) m2: pc save cycle (longword write) m3: vector address read cycle (longword read) m4: fetch start instruction of interrupt handling routine
80 fde mee mme ee fd f 3 3 interrupt accepted irq m1 m2 1 m3 1 5 + m1 + m2 + m3 instruction (instruction replaced by interrupt exception handling) overrun fetch (edge) (level) interrupt service routine first instruction when m1 = m2 = m3, the interrupt response time is 11 cycles. f (instruction fetch) instruction fetched from memory where program is stored. d (instruction decoding) the fetched instruction is decoded. e (instruction execution) data operations and address calculations are performed according to the decoded results. m (memory access) data in memory is accessed. note: for the interrupt acceptance timing, see table 4.1, exception source detection and start of handling, in section 4.1.2, exception handling operation. irqout figure 5.4 example of pipelining in irq interrupt acceptance 5.6 usage notes when the following operations are performed in the order shown when a pin to which irq input is assigned is designated as a general input pin by the pin function controller (pfc) and inputs a low- level signal, the irq falling edge is detected, and an interrupt request is detected, immediately after the setting in (b) is performed: ? (a) ? (b) therefore, when switching the pin function from general input pin to irq input, the pin function controller (pfc) setting should be changed to irq input while the pin to which irq input is assigned is high.
81 section 6 user break controller (ubc) 6.1 overview the user break controller (ubc) simplifies the debugging of user programs. break conditions are set in the ubc and a user break interrupt request is sent to the cpu in response to the contents of a cpu or dmac bus cycle. this function can implement an effective self-monitoring debugger, enabling a program to be debugged by itself without using a large in-circuit emulator. 6.1.1 features ? the following break conditions can be set: ? address ? cpu cycle or dma cycle ? instruction fetch or data access ? read or write ? operand size (longword access, word access, or byte access) ? when break conditions are met, a user break interrupt is generated. a user-created user break interrupt exception routine can then be executed. ? when a break is set to a cpu instruction fetch, the break occurs just before the fetched instruction.
82 6.1.2 block diagram figure 6.1 shows a block diagram of the user break controller. internal bus bus interface break condition comparator module bus bbr bamrh barh bamrl barl interrupt request interrupt controller user break interrupt generating circuit ubc barh, barl: break address registers h and l bamrh, bamrl: break address mask registers h and l bbr: break bus cycle register figure 6.1 block diagram of user break controller
83 6.1.3 register configuration the user break controller has five registers as listed in table 6.1. these registers are used for setting break conditions. table 6.1 user break controller registers name abbr. r/w address * initial value bus width break address register high barh r/w h'5ffff90 h'0000 8, 16, 32 break address register low barl r/w h'5ffff92 h'0000 8, 16, 32 break address mask register high bamrh r/w h'5ffff94 h'0000 8, 16, 32 break address mask register low bamrl r/w h'5ffff96 h'0000 8, 16, 32 break bus cycle register bbr r/w h'5ffff98 h'0000 8, 16, 32 note: * only the values of bits a27?24 and a8?0 are valid; bits a23?9 are ignored. for details on the register addresses, see section 8.3.5, area descriptions.
84 6.2 register descriptions 6.2.1 break address registers (bar) there are two break address registers?reak address register h (barh) and break address register l (barl)?hat together form a single group. both are 16-bit read/write registers. barh stores the upper bits (bits 31?6) of the address of the break condition. barl stores the lower bits (bits 15?) of the address of the break condition. a reset initializes both barh and barl to h'0000. they are not initialized in standby mode. barh: break address register h. bit: 15 14 13 12 11 10 9 8 bit name: ba31 ba30 ba29 ba28 ba27 ba26 ba25 ba24 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: ba23 ba22 ba21 ba20 ba19 ba18 ba17 ba16 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w ? barh bits 15? (break address 31?6 (ba31?a16)): ba31?a16 store the upper bit values (bits 31?6) of the address of the break condition. barl: break address register l. bit: 15 14 13 12 11 10 9 8 bit name: ba15 ba14 ba13 ba12 ba11 ba10 ba9 ba8 initial value: 00000000 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: ba7 ba6 ba5 ba4 ba3 ba2 ba1 ba0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w ? barl bits 15? (break address 15? (ba15?a0)): ba15?a0 store the lower bit values (bits 15?) of the address of the break condition.
85 6.2.2 break address mask register (bamr) the two break address mask registers?reak address mask register h (bamrh) and break address mask register l (barml)?ogether form a single group. both are 16-bit read/write registers. bamrh determines which of the bits in the break address set in barh are masked. bamrl determines which of the bits in the break address set in barl are masked. a reset initializes bamrh and barml to h'0000. they are not initialized in standby mode. bamrh: break address mask register h. bit: 15 14 13 12 11 10 9 8 bit name: bam31 bam30 bam29 bam28 bam27 bam26 bam25 bam24 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: bam23 bam22 bam21 bam20 bam19 bam18 bam17 bam16 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w ? bamrh bits 15? (break address mask 31?6 (bam31?am16)): bam31?am16 specify whether bits ba31?a16 of the break address set in barh are masked or not. bamrl: break address mask register l. bit: 15 14 13 12 11 10 9 8 bit name: bam15 bam14 bam13 bam12 bam11 bam10 bam9 bam8 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: bam7 bam6 bam5 bam4 bam3 bam2 bam1 bam0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w ? bamrl bits 15? (break address mask 15? (bam15?am0)): bam15?am0 specify whether bits ba15?a0 of the break address set in barh are masked or not. bits 15?: bamn description 0 break address bit ban is included in the break condition (initial value) 1 break address bit ban is not included in the break condition n = 31?
86 6.2.3 break bus cycle register (bbr) the break bus cycle register (bbr) is a 16-bit read/write register that selects the following four break conditions: ? cpu cycle or dma cycle ? instruction fetch or data access ? read or write ? operand size (byte, word, longword). a reset initializes bbr to h'0000. it is not initialized in standby mode. bit: 15 14 13 12 11 10 9 8 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: bit: 7 6 5 4 3 2 1 0 bit name: cd1 cd0 id1 id0 rw1 rw0 sz1 sz0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w ? bits 15? (reserved): these bits are always read as 0. the write value should always be 0. ? bits 7 and 6 (cpu cycle/dma cycle select (cd1 and cd0)): cd1 and cd0 select whether to break on cpu and/or dma bus cycles. bit 7: cd1 bit 6: cd0 description 0 0 no break interrupt occurs (initial value) 1 break only on cpu cycles 1 0 break only on dma cycles 1 break on both cpu and dma cycles
87 ? bits 5 and 4 (instruction fetch/data access select (id1, id0)): id1 and id0 select whether to break on instruction fetch and/or data access bus cycles. bit 5: id1 bit 4: id0 description 0 0 no break interrupt occurs (initial value) 1 break only on instruction fetch cycles 1 0 break only on data access cycles 1 break on both instruction fetch and data access cycles ? bits 3 and 2 (read/write select (rw1, rw0)): rw1 and rw0 select whether to break on read and/or write access cycles. bit 3: rw1 bit 2: rw0 description 0 0 no break interrupt occurs (initial value) 1 break only on read cycles 1 0 break only on write cycles 1 break on both read and write cycles ? bits 1 and 0 (operand size select (sz1, sz0)): sz1 and sz0 select the bus cycle operand size as a break condition. bit 1: sz1 bit 0: sz0 description 0 0 operand size is not a break condition (initial value) 1 break on byte access 1 0 break on word access 1 break on longword access note: when setting a break on an instruction fetch, clear the sz0 bit to 0. all instructions will be considered to be accessed as words (even those instructions in on-chip memory for which two instructions can be fetched simultaneously in a single bus cycle). instruction fetch is by word access and cpu/dmac data access is by the specified operand size. the access is not determined by the bus width of the space being accessed.
88 6.3 operation 6.3.1 flow of user break operation the flow from setting of break conditions to user break interrupt exception handling is described below. 1. break conditions are set in the break address register (bar), break address mask register (bamr), and break bus cycle register (bbr). set the break address in bar, the address bits to be masked in bamr and the type of break bus cycle in bbr. when even one of the bbr groups (cpu cycle/dma cycle select bits (cd1, cd0), instruction fetch/data access select bits (id1, id0), read/write select bits (rw1, rw0)) is set to 00 (no user break interrupt), there will be no user break even when all other conditions are consistent. to use a user break interrupt, set conditions for all three pairs. 2. the ubc checks to see if the set conditions are satisfied, using the system shown in figure 6.2. when the break conditions are satisfied, the ubc sends a user break interrupt request to the interrupt controller. 3. on receiving the user break interrupt request, the interrupt controller checks its priority level. the user break interrupt has priority level 15, so it is accepted only if the interrupt mask level in bits i3?0 in the status register (sr) is 14 or lower. when the i3?0 bit level is 15, the user break interrupt cannot be accepted, but is held pending until user break interrupt exception handling is carried out. nmi exception handling sets i3?0 to level 15, so a user break cannot occur during the nmi handling routine unless the nmi handling routine itself begins by reducing i3?0 to level 14 or lower. section 5, interrupt controller (intc), describes the handling of priority levels in greater detail. 4. intc sends a request signal for a user break interrupt to the cpu. when the cpu receives it, it starts user break interrupt exception handling. section 5.4, interrupt operation, describes interrupt exception handling in more detail.
89 sz1 sz0 user break interrupt rw1 rw0 id1 id0 cd1 cd0 barh/barl bamrh/bamrl 32 32 32 32 32 internal address bits 31 0 cpu cycle dma cycle instruction fetch data access read cycle write cycle byte size word size longword size figure 6.2 break condition logic
90 6.3.2 break on instruction fetch cycles to on-chip memory on-chip memory (on-chip rom (sh7034 only) and ram) is always accessed 32 bits each bus cycle. two instructions are therefore fetched in a bus cycle from on-chip memory . although only a single bus cycle occurs for the two-instruction fetch, a break can be set on either instruction by placing the corresponding address in the break address registers (bar). in other words, to break the second of the two instructions fetched, set its start address in the bar. the break will then occur after the first instruction executes. 6.3.3 program counter (pc) value saved in user break interrupt exception processing break on instruction fetch: the program counter (pc) value saved in user break interrupt exception processing for an instruction fetch is the address set as the break condition. the user break interrupt is generated before the fetched instruction is executed. if a break condition is set on the fetch cycle of a delayed slot instruction immediately following a delayed branch instruction or on the fetch cycle of an instruction that follows an interrupt-disabling instruction, however, the user break interrupt is not accepted immediately, so the instruction is executed. the user break interrupt is not accepted until immediately after that instruction. the pc value that will be saved is the start address of the next instruction that is able to accept the interrupt. break on data access (cpu/dmac): the program counter (pc) value is the top address of the next instruction after the last executed instruction at the time when the user break exception processing is activated. when data access (cpu/dmac) is set as a break condition, the place where the break will occur cannot be specified exactly. the break will occur at the instruction fetched close to where the data access that is to receive the break occurs.
91 6.4 setting user break conditions cpu instruction fetch bus cycle: ? register settings: barh = h'0000, barl = h'0404, bbr = h'0054 conditions set: address = h'00000404, bus cycle = cpu, instruction fetch, read (operand size not included in conditions) a user break interrupt will occur immediately before the instruction at address h'00000404. if the instruction at address h'00000402 can accept an interrupt, the user break exception handling will be executed after that instruction is executed. the instruction at h'00000404 will not be executed. the value saved to the pc is h'00000404. ? register settings: barh = h'0015, barl = h'389c, bbr = h'0058 conditions set: address = h'0015389c, bus cycle = cpu, instruction fetch, write (operand size not included in conditions) no user break interrupt occurs, because no instruction fetch cycle is ever a write cycle. ? register settings: barh = h'0003, barl = h'0147, bbr = h'0054 conditions set: address = h'00030147, bus cycle = cpu, instruction fetch, read (operand size not included in conditions) no user break interrupt occurs, because instructions are always fetched from even addresses. if the first fetched address after a branch is odd and a user break is set on this address, however, user break exception handling will be carried out after address error exception handling. cpu data access bus cycle: ? register settings: barh = h'0012, barl = h'3456, bbr = h'006a conditions set: address = h'00123456, bus cycle = cpu, data access, write, word a user break interrupt occurs when word data is written to address h'00123456. ? register settings: barh = h'00a8, barl = h'0391, bbr = h'0066 conditions set: address = h'00a80391, bus cycle = cpu, data access, read, word no user break interrupt occurs, because word data access is always to an even address. dma cycle: ? register setting: barh = h'0076, barl = h'bcdc, bbr = h'00a7 conditions set: address = h'0076bcdc, bus cycle = dma, data access, read, longword a user break interrupt occurs when longword data is read from address h'0076bcdc. ? register setting: barh = h'0023, barl = h'45c8, bbr = h'0094 conditions set: address = h'002345c8, bus cycle = dma, instruction fetch, read (operand size not included) no user break interrupt occurs, because a dma cycle includes no instruction fetch.
92 6.5 notes 6.5.1 on-chip memory instruction fetch two instructions are simultaneously fetched from on-chip memory. if a break condition is set on the second of these two instructions but the contents of the ubc break condition registers are changed so as to alter the break condition immediately after the first of the two instructions is fetched, a user break interrupt will still occur when the second instruction is fetched. 6.5.2 instruction fetch at branches when a conditional branch instruction or trapa instruction causes a branch, instructions are fetched and executed as follows: 1. conditional branch instruction, branch taken: bt, bf instruction fetch cycles: conditional branch fetch next-instruction overrun fetch next- but-one-instruction overrun fetch branch destination fetch instruction execution: conditional branch instruction execution branch destination instruction execution 2. trapa instruction, branch taken: trapa instruction fetch cycles: trapa instruction fetch next-instruction overrun fetch next- but-one-instruction overrun fetch branch destination fetch instruction execution: trapa instruction execution branch destination instruction execution when a conditional branch instruction or trapa instruction causes a branch, the branch destination will be fetched after the next instruction or the one after that does an overrun fetch. when the next instruction or the one after that is set as a break condition, a branch will result in the generation of a user break interrupt at the next instruction or the instruction after that, neither of which instructions will be executed.
93 6.5.3 instruction fetch break if a break is attempted at the task a return destination instruction fetch, task b is activated before the ubc interrupt by interrupt b generated during task a processing, and the ubc interrupt is handled after the interrupt b exception handling. (1) cause the sh7032/sh7034 chip operates as follows. f f de e mee mme ee m mm e e e fd f interrupt b accepted interrupt exception handling interrupt exception handling ubc interrupt accepted
break condition instruction replaced by interrupt exception handling overrun fetch task b first instruction fetch (instruction replaced by interrupt exception handling) (0xf000978 overrun fetch) ubc first instruction fetch 0x00011a0a 0x00011a0c 0xf000974 0x02000030 f figure 6.3 ubc operation it actually takes at least two cycles for the ubc interrupt generated by the address 0x00011a0c instruction fetch cycle to be sent to the interrupt controller and interrupt exception handling to begin. however, as shown in figure 6.3, when the ubc interrupt is generated, previously generated interrupt b initiated by task b is accepted first, and the ubc interrupt is accepted after completion of the interrupt b exception handling. (2) remedy there is no way of preventing this operation by hardware. a software solution, such as the use of a flag, must be employed.
94
95 section 7 clock pulse generator (cpg) 7.1 overview the superh microcomputer has a built-in clock pulse generator (cpg) that supplies the chip and external devices with a clock pulse. the cpg makes the chip run at the oscillation frequency of the crystal resonator. the cpg consists of an oscillator and a duty cycle correction circuit (figure 7.1). the cpg can be made to generate a clock signal by connecting it to a crystal resonator or by inputting an external clock. (the cpg is halted in standby mode.) xtal extal ck system clock oscillator duty cycle correction circuit internal clock ( ) cpg figure 7.1 block diagram of clock pulse generator 7.2 clock source clock pulses can be supplied from a connected crystal resonator or an external clock. 7.2.1 connecting a crystal resonator circuit configuration: a crystal resonator can be connected as shown in figure 7.2. use the damping resistance rd shown in table 7.1. use an at-cut parallel resonating crystal with a frequency equal to the system clock (ck) frequency. connect load capacitors (c l1 and c l2 ) as shown in the figure. the clock pulse produced by the crystal resonator and internal pulse generator is sent to the duty cycle correction circuit where its duty cycle is corrected. it is then supplied to the chip and to external devices.
96 xtal extal c l1 = c l2 =10?2 pf c l1 rd c l2 figure 7.2 connection of crystal resonator (example) table 7.1 damping resistance frequency [mhz] 2 4 8 12 16 20 rd [ ? ] 1k 500 200 0 0 0 crystal resonator: figure 7.3 shows an equivalent circuit of the crystal resonator. use a crystal resonator with the characteristics listed in table 7.2. c 0 xtal extal c l lrs figure 7.3 crystal resonator equivalent circuit table 7.2 crystal resonator parameters frequency (mhz) parameter 2 4 8 12 16 20 rs max [ ?
97 7.2.2 external clock input an external clock signal can be input at the extal pin as shown in figure 7.4. the xtal pin should be left open. the frequency must be equal to the system clock (ck) frequency. the specifications for the waveform of the external clock input are given below. make the external clock frequency the same as the system clock (ck). xtal extal open external clock input figure 7.4 external clock input method t exr t exf v il v ih 1/2 v cc t exh t exl t cyc figure 7.5 input clock waveform table 7.3 input clock specifications 5 v specifications (fmax = 20 mhz) * 1 3.3 v specifications (fmax = 12.5 mhz) 3.3 v specifications (fmax = 20 mhz) * 2 unit t exr/f (v il v ih ) max = 5 max = 10 max = 5 ns t exh/l min = 10 min = 20 min = 15 ns notes: * 1 except sh7034b * 2 sh7034b only
98 7.3 usage notes board design: when designing the board, place the crystal resonator and its load capacitors as close as possible to the xtal and extal pins. route no other signal lines near the xtal and extal pin signal lines to prevent induction from interfering with correct oscillation. see figure 7.6. xtal extal c l1 c l2 no crossing signal lines figure 7.6 precaution on oscillator circuit board design duty cycle correction circuit: duty cycle corrections are conducted for an input clock over 5 mhz. duty cycles may not be corrected for a clock of under 5 mhz, but ac characteristics for the high-level pulse width (t ch ) and low-level pulse width (t cl ) of the clock are satisfied, and the chip will operate normally. figure 7.7 shows the standard characteristics of duty cycle correction. this duty cycle correction circuit is not for correcting transient fluctuations and jitter in the input clock. thus, it takes several tens of microseconds to obtain a stable clock after duty cycle correction is performed.
99 70 60 50 40 30 125 1020 (mhz) 70 60 50 40 30 input duty * input frequency note: * with the sh7034b, compensation is performed in the input duty range of 60% to 40%. output duty figure 7.7 duty cycle correction circuit standard characteristics
100
101 section 8 bus state controller (bsc) 8.1 overview the bus state controller (bsc) divides address space and outputs control signals for all kinds of memory and peripheral chips. bsc functions enable the chip to be connected directly to dram, sram, rom, and peripheral chips without the use of external circuits, simplifying system design and allowing high-speed data transfer in a compact system. 8.1.1 features the bsc has the following features: ? address space is divided into eight areas ? a maximum 4-mbyte linear address space for each of eight areas, 0? (area 1 can be up to 16-mbyte linear space when set for dram). (the space that can actually be used varies with the type of memory connected.) ? bus width (8 bits or 16 bits) can be selected by access address ? on-chip rom and ram is accessed in one cycle (32 bits wide) ? wait states can be inserted using the wait pin ? wait state insertion can be controlled by software. register settings can be used to specify the insertion of 1? cycles for areas 0, 2, and 6 (long wait function) ? the type of memory connected can be specified for each area ? outputs control signals for accessing the memory and peripheral chips connected to the area ? direct interface to dram ? multiplexes row/column addresses according to dram capacity ? two types of byte access signals (dual-cas system and dual-we system) ? supports burst operation (high-speed page mode) ? supports cas-before-ras refresh and self-refresh ? access control for all memory and peripheral chips ? address/data multiplex function ? parallel execution of external writes etc. with internal access (warp mode) ? supports parity check and generation for data bus ? odd parity/even parity selectable ? interrupt request generated for parity error (pei interrupt request signal) ? refresh counter can be used as an interval timer ? interrupt request generated at compare match (cmi interrupt request signal)
102 8.1.2 block diagram figure 8.1 shows a block diagram of the bus state controller. wcr1 wcr2 wcr3 bcr dcr rcr cash , casl cmi interrupt request dph, dpl pei interrupt request wait rtcsr rtcnt rtcor pcr internal bus interrupt controller bus interface area control unit comparator module bus rd wrh , wrl hbs , lbs ah cs7 to cs0 ras wait control unit dram control unit parity control unit peripheral bus bsc wcr: wait state control register rtcsr: refresh timer control/status register bcr: bus control register rtcnt: refresh timer counter dcr: dram area control register rtcor: refresh time constant register rcr: refresh control register pcr: parity control register figure 8.1 block diagram of bsc
103 8.1.3 pin configuration table 8.1 shows the bsc pin configuration. table 8.1 pin configuration name abbreviation i/o function chip select 7? cs7 cs0 o chip select signal that indicates the area being accessed read rd o strobe signal that indicates the read cycle high write wrh o strobe signal that indicates write cycle to upper 8 bits low write wrl o strobe signal that indicates write cycle to lower 8 bits write wr * 1 o strobe signal that indicates write cycle high byte strobe hbs * 2 o strobe signal that indicates access to upper 8 bits low byte strobe lbs * 3 o strobe signal that indicates access to lower 8 bits row address strobe ras o dram row address strobe signal high column address strobe cash o column address strobe signal for accessing the upper 8 bits of the dram low column address strobe casl o column address strobe signal for accessing the lower 8 bits of the dram address hold ah o signal for holding the address for address/data multiplexing wait wait i wait state request signal address bus a21?0 o address output data bus ad15?d0 i/o data i/o. during address/data multiplexing, address output and data input/output data bus parity high dph i/o parity data i/o for upper byte data bus parity low dpl i/o parity data i/o for lower byte notes: * 1 doubles with the wrl pin. (selected by the bas bit in bcr. see section 8.2.1, bus control register (bcr), for details.) * 2 doubles with the a0 pin. (selected by the bas bit in bcr. see section 8.2.1, bus control register (bcr), for details.) * 3 doubles with the wrh pin. (selected by the bas bit in bcr. see section 8.2.1, bus control register (bcr), for details.)
104 8.1.4 register configuration the bsc has ten registers (listed in table 8.2) which control space division, wait states, dram interface, and parity check. table 8.2 register configuration name abbr. r/w initial value address * 1 bus width bus control register bcr r/w h'0000 h'5ffffa0 8,16,32 wait state control register 1 wcr1 r/w h'ffff h'5ffffa2 8,16,32 wait state control register 2 wcr2 r/w h'ffff h'5ffffa4 8,16,32 wait state control register 3 wcr3 r/w h'f800 h'5ffffa6 8,16,32 dram area control register dcr r/w h'0000 h'5ffffa8 8,16,32 parity control register pcr r/w h'0000 h'5ffffaa 8,16,32 refresh control register rcr r/w h'0000 h'5ffffac 8,16,32 * 2 refresh timer control/status register rtcsr r/w h'0000 h'5ffffae 8,16,32 * 2 refresh timer counter rtcnt r/w h'0000 h'5ffffb0 8,16,32 * 2 refresh time constant register rtcor r/w h'00ff h'5ffffb2 8,16,32 * 2 notes: * 1 only the values of bits a27?24 and a8?0 are valid; bits a23?9 are ignored. for details on the register addresses, see section 8.3.5, area descriptions. * 2 write only with word transfer instructions. see section 8.2.11, notes on register access, for details on writing.
105 8.1.5 overview of areas the sh microprocessors have a 32-bit address space in the architecture, but the upper 4 bits are ignored. table 8.3 outlines the space divisions. as shown, the space is divided into areas 0? according to the value of the upper addresses. each area is allocated a specific type of space. when the area is accessed, a strobe signal that matches the type of area space is generated. this allocates peripheral chips and memory devices according to the type of the area spaces and allows them to be directly linked to this chip. some areas are of a fixed type based on their address while others can be selected in registers. area 0 can be used as an on-chip rom space or external memory space in the sh7034. in the sh7032, it can only be used as external memory space. area 1 can be used as dram space or external memory space. dram space enables direct connection to dram and outputs ras , cas and multiplexed addresses. areas 2? can only be used as external memory space. area 5 can be used as on-chip supporting module space or external memory space. area 6 can be used as address/data multiplexed i/o space or external memory space. for address/data multiplexed i/o space, an address and data are multiplexed and input/output from pins ad15?d0. area 7 can be used as on-chip ram space or external memory space. the bus width of the data bus is basically switched between 8 bits and 16 bits according to the value of address bit a27. for the following areas, however, the bus width is determined by conditions other than the a27 bit value. ? on-chip rom space in area 0: always 32 bits ? external memory space in area 0: 8 bits when md0 pin is 0, 16 bits when the pin is 1 ? on-chip supporting module space in area 5: 8 bits when the a8 address bit is 0, 16 bits when it is 1 ? area 6: if a27 = 0, area 6 is 8 bits when the a14 address bit is 0, 16 bits when a14 is 1 ? on-chip ram space in area 7: always 32 bits see table 8.6 in section 8.3, address space subdivision, for more information on how the space is divided.
106 table 8.3 overview of space divisions area address assignable memory capacity (linear space) bus width cs output 0 h'0000000?'0ffffff on-chip rom * 1 64 kb 32 external memory * 2 4 mb 8/16 * 3 cs0 1 h'1000000?'1ffffff external memory 4 mb 8 cs1 dram * 4 16 mb 8 ras cas 2 h'2000000?'2ffffff external memory 4 mb 8 cs2 3 h'3000000?'3ffffff external memory 4 mb 8 cs3 4 h'4000000?'4ffffff external memory 4 mb 8 cs4 5 h'5000000?'5ffffff on-chip supporting modules 512 b 8/16 * 5 6 h'6000000?'6ffffff external memory * 7 4 mb 8/16 * 6 cs6 multiplexed i/o 4 mb 7 h'7000000?'7ffffff external memory 4 mb 8 cs7 0 h'8000000?'8ffffff on-chip rom * 1 64 kb 32 external memory * 2 4 mb 8/16 * 3 cs0 1 h'9000000?'9ffffff external memory 4 mb 16 cs1 dram * 4 16 mb 16 ras cas 2 h'a000000?'affffff external memory 4 mb 16 cs2 3 h'b000000?'bffffff external memory 4 mb 16 cs3 4 h'c000000?'cffffff external memory 4 mb 16 cs4 5 h'd000000?'dffffff external memory 4 mb 16 cs5 6 h'e000000?'effffff external memory 4 mb 16 cs6 7 h'f000000?'fffffff on-chip ram 8 kb * 8 , 4 kb * 9 32 notes: * 1 when md2?d0 pins are 010 (sh7034) * 2 when md2?d0 pins are 000 or 001 * 3 select with md0 pin * 4 select with drame bit in bcr * 5 divided into 8-bit and 16-bit space according to value of address bit a8. (longword accesses are inhibited, however, for on-chip supporting modules with bus widths of 8 bits. some on-chip supporting modules with bus widths of 16 bits also have registers that are only byte-accessible and registers for which byte access is inhibited. for details, see the sections on the individual modules.) * 6 divided into 8-bit space and 16-bit space by value of address bit a14 * 7 select with ioe bit in bcr * 8 for sh7032 * 9 for sh7034
107 8.2 register descriptions 8.2.1 bus control register (bcr) the bus control register (bcr) is a 16-bit read/write register that selects the functions of areas and status of bus cycles. it is initialized to h'0000 by a power-on reset, but is not initialized by a manual reset or in standby mode. bit: 15 14 13 12 11 10 9 8 bit name: drame ioe warp rddty bas initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: ? bit 15 (dram enable bit (drame)): drame selects whether area 1 is used as an external memory space or dram space. 0 sets it as external memory space and 1 sets it as dram space. the setting of the dram area control register is valid only when this bit is set to 1. bit 15: drame description 0 area 1 is external memory space (initial value) 1 area 1 is dram space ? bit 14 (multiplexed i/o enable bit (ioe)): ioe selects whether area 6 is used as external memory space or an address/data multiplexed i/o area. 0 sets it as external memory space and 1 sets it as address/data multiplexed i/o space. with address/data multiplexed i/o space, the address and data are multiplexed and input/output is from ad15?d0. bit 14: ioe description 0 area 6 is external memory space (initial value) 1 area 6 is an address/data multiplexed i/o area
108 ? bit 13 (warp mode bit (warp)): warp selects warp or normal mode. 0 sets normal mode and 1 sets warp mode. in warp mode, some external accesses are carried out in parallel with internal access. bit 13: warp description 0 normal mode: external and internal accesses are not performed simultaneously (initial value) 1 warp mode: external and internal accesses are performed simultaneously ? bit 12 (rd duty (rddty)): rddty selects 35% or 50% of the t1 state as the high-level duty cycle ratio of signal rd . 0 sets 50%, 1 sets 35%. bit 12: rddty description 0 rd signal high-level duty cycle is 50% of t1 state (initial value) 1 rd signal high-level duty cycle is 35% of t1 state ? bit 11 (byte access select (bas)): bas selects whether byte access control signals are wrh , wrl , and a0, or lbs , wr and hbs during word space accesses. when this bit is cleared to 0, wrh , wrl , and a0 signals are valid; when set to 1, lbs , wr , and hbs signals are valid. bit 11: bas description 0 wrh , wrl , and a0 enabled (initial value) 1 lbs , wr , and hbs enabled ? bits 10? (reserved): these bits are always read as 0. the write value should always be 0.
109 8.2.2 wait state control register 1 (wcr1) wait state control register 1 is a 16-bit read/write register that controls the number of states for accessing each area and whether wait states are used. wcr1 is initialized to h'ffff by a power- on reset. it is not initialized by a manual reset or in standby mode. bit: 15 14 13 12 11 10 9 8 bit name: rw7 rw6 rw5 rw4 rw3 rw2 rw1 rw0 initial value: 1 1 1 1 1 1 1 1 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: ww1 initial value: 1 1 1 1 1 1 1 1 r/w: r/w ? bits 15? (wait state control during read (rw7?w0)): rw7?w0 determine the number of states in read cycles for each area and whether or not to sample the signal input from the wait pin. bits rw7?w0 correspond to areas 7?, respectively. if a bit is cleared to 0, the wait signal is not sampled during the read cycle for the corresponding area. if it is set to 1, sampling takes place. for the external memory spaces of areas 1, 3?, and 7, read cycles are completed in one state when the corresponding bits are cleared to 0. when they are set to 1, the number of wait states is 2 plus the wait signal value. for the external memory space of areas 0, 2, and 6, read cycles are completed in one state plus the number of long wait states (set in wait state controller 3 (wcr3)) when the corresponding bits are cleared to 0. when they are set to 1, the number of wait states is 1 plus the long wait state; when the wait signal is low as well, a wait state is inserted. the dram space (area 1) finishes the column address output cycle in one state (short pitch) when the rw1 bit is 0, and in 2 states plus the wait signal value (long pitch) when rw1 is 1. when rw1 is set to 1, the number of wait states selected in wait state insertion bits 1 and 0 (rlw0 and rlw1) for cas-before-ras (cbr) refresh in the refresh control register (rcr) are inserted during the cbr refresh cycle, regardless of the status of the wait signal. the read cycle of the address/data multiplexed i/o space (area 6) is 4 states plus the wait states from the wait signal, regardless of the setting of the rw6 bit. the read cycle of the on-chip supporting module space (area 5) finishes in 3 states, regardless of the setting of the rw5 bit, and the wait signal is not sampled. the read cycles of on-chip rom (area 0) and on-chip ram (area 7) finish in 1 state, regardless of the settings of bits rw0 and rw7. the wait signal is not sampled for either.
110 table 8.4 summarizes read cycle state information. table 8.4 read cycle states read cycle states external memory space internal space bits 15?: rw7?w0 wait pin input signal external memory space dram space multi- plexed i/o on-chip supporting modules on-chip rom and ram 0 not sampled during read cycle * 1 areas 1, 3?,7: 1 state, fixed areas 0, 2, 6: 1 state + long wait state column add- ress cycle: 1 state, fixed (short pitch) 4 states + wait states from wait 3 states, fixed 1 state, fixed 1 sampled during read cycle (initial value) areas 1, 3?, 7: 2 states + wait states from wait areas 0, 2, 6: 1 state + long wait state + wait state from wait column address cycle: 2 states + wait state from wait (long pitch) * 2 notes: * 1 sampled in the address/data multiplexed i/o space * 2 during a cbr refresh, the wait signal is ignored and the wait state from the rlw1 and rlw0 bits in rcr is inserted. ? bits 7? (reserved): these bits are always read as 1. the write value should always be 1. ? bit 1 (wait state control during write (ww1)): ww1 determines the number of states in write cycles for the dram space (area 1) and whether or not to sample the wait signal. when the dram enable bit (drame) in bcr is set to 1 and area 1 is being used as dram space, clearing ww1 to 0 makes the column address output cycle finish in 1 state (short pitch). when ww1 is set to 1, it finishes in 2 states plus the wait states from the wait signal (long pitch). note: write 0 to ww1 only when area 1 is used as dram space (drame bit in bcr is 1). never write 0 to ww1 when area 1 is used as external memory space (drame is 0). bit 1: ww1 dram space (drame = 1) area 1 external memory space (drame = 0) 0 column address cycle: 1 state (short pitch) setting inhibited 1 column address cycle: 2 states + wait state from wait (long pitch) (initial value) 2 states + wait state from wait ? bit 0 (reserved): this bit is always read as 1. the write value should always be 1.
111 8.2.3 wait state control register 2 (wcr2) wait state control register 2 is a 16-bit read/write register that controls the number of states for accessing each area with a dma single address mode transfer and whether wait states are used. wcr2 is initialized to h'ffff by a power-on reset. it is not initialized by a manual reset or in standby mode. bit: 15 14 13 12 11 10 9 8 bit name: drw7 drw6 drw5 drw4 drw3 drw2 drw1 drw0 initial value: 1 1 1 1 1 1 1 1 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: dww7 dww6 dww5 dww4 dww3 dww2 dww1 dww0 initial value: 1 1 1 1 1 1 1 1 r/w: r/w r/w r/w r/w r/w r/w r/w r/w ? bits 15? (wait state control during single-mode dma transfer (drw7?rw0)): drw7 drw0 determine the number of states in single-mode dma memory read cycles for each area and whether or not to sample the wait signal. bits drw7?rw0 correspond to areas 7?, respectively. if a bit is cleared to 0, the wait signal is not sampled during the single-mode dma memory read cycle for the corresponding area. if it is set to 1, sampling takes place. for the external memory spaces of areas 1, 3?, and 7, single-mode dma memory read cycles are completed in one state when the corresponding bits are cleared to 0. when they are set to 1, the number of wait states is 2 plus the wait states from the wait signal. for the external memory space of areas 0, 2, and 6, single-mode dma memory read cycles are completed in one state plus the long wait state number (set in wait state controller 3 (wcr3)) when the corresponding bits are cleared to 0. when they are set to 1, the number of wait states is 1 plus the long wait state; when the wait signal is low as well, a wait state is inserted. the dram space (area 1) finishes the column address output cycle in one state (short pitch) when the drw1 bit is 0, and in 2 states plus the wait states from the wait signal (long pitch) when drw1 is 1. the single-mode dma memory read cycle of the address/data multiplexed i/o space (area 6) is 4 states plus the wait states from the wait signal, regardless of the setting of the drw6 bit.
112 table 8.5 single-mode dma memory read cycle states (external memory space) single-mode dma memory read cycle states (external memory space) bits 15?: drw7?rw0 wait pin input signal external memory space dram space multiplexed i/o 0 not sampled during single-mode dma memory read cycle * areas 1, 3?,7: 1 state, fixed areas 0, 2, 6: 1 state + long wait state column address cycle: 1 state, fixed (short pitch) 4 states + wait states from wait 1 sampled during single-mode dma memory read cycle (initial value) areas 1, 3?, 7: 2 states + wait states from wait areas 0, 2, 6: 1 state + long wait state + wait state from wait column address cycle: 2 states + wait state from wait (long pitch) note: * sampled in the address/data multiplexed i/o space. ? bits 7? (single-mode dma memory write wait state control (dww7?ww0)): dww7 dww0 determine the number of states in single-mode dma memory write cycles for each area and whether or not to sample the wait signal. bits dww7?ww0 correspond to areas 7?, respectively. if a bit is cleared to 0, the wait signal is not sampled during the single- mode dma memory write cycle for the corresponding area. if it is set to 1, sampling takes place. the number of states for areas accesses based on bit settings is the same as indicated for single-mode dma memory read cycles. see bits 15?, wait state control during single- mode dma memory transfer (drw7?rw0), for details. table 8.6 summarizes single-mode dma memory write cycle state information.
113 table 8.6 single-mode dma memory write cycle states (external memory space) single-mode dma memory write cycle states (external memory space) bits 15?: dww7?ww0 wait pin input signal external memory space dram space multiplexed i/o 0 not sampled during single-mode dma memory write cycle * areas 1, 3?,7: 1 state, fixed areas 0, 2, 6: 1 state + long wait state column address cycle: 1 state, fixed (short pitch) 4 states + wait state from wait 1 sampled during single-mode dma memory write cycle (initial value) areas 1, 3?, 7: 2 states + wait state from wait areas 0, 2, 6: 1 state + long wait state + wait state from wait column address cycle: 2 states + wait state from wait (long pitch) note: * sampled in the address/data multiplexed i/o space. 8.2.4 wait state control register 3 (wcr3) wait state control register 3 is a 16-bit read/write register that controls wait pin pull-up and the insertion of long wait states. wcr3 is initialized to h'f800 by a power-on reset. it is not initialized by a manual reset or in standby mode. bit: 15 14 13 12 11 10 9 8 bit name: wpu a02lw1 a02lw0 a6lw1 a6lw0 initial value: 1 1 1 1 1 0 0 0 r/w: r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: ? bit 15 (wait pin pull-up control (wpu)): wpu controls whether the wait pin is pulled up or not. when cleared to 0, the pin is not pulled up; when set to 1, it is pulled up. bit 15: wpu description 0 wait pin is not pulled up 1 wait pin is pulled up (initial value)
114 ? bits 14 and 13 (long wait insertion in areas 0 and 2, bits 1, 0 (a02lw1 and a02lw0)): a02lw1 and a02lw0 select the long wait states to be inserted (1? states) when accessing external memory space of areas 0 and 2. bit 14: a02lw1 bit 13: a02lw0 description 0 0 1 state inserted 1 2 states inserted 1 0 3 states inserted 1 4 states inserted (initial value) ? bits 12 and 11 (long wait insertion in area 6, bits 1, 0 (a6lw1 and a6lw0)): a6lw1 and a6lw0 select the long wait states to be inserted (1? states) when accessing external memory space of area 6. bit 12: a6lw1 bit 11: a6lw0 description 0 0 1 state inserted 1 2 states inserted 1 0 3 states inserted 1 4 states inserted (initial value) ? bits 10? (reserved): these bits are always read as 0. the write value should always be 0. 8.2.5 dram area control register (dcr) the dram area control register (dcr) is a 16-bit read/write register that selects the type of dram control signal, the number of precharge cycles, the burst operation mode, and the use of address multiplexing. dcr settings are valid only when the drame bit in bcr is set to 1. it is initialized to h'0000 by a power-on reset, but is not initialized by a manual reset or in standby mode. bit: 15 14 13 12 11 10 9 8 bit name: cw2 rasd tpc be cdty mxe mxc1 mxc0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w
115 bit: 7 6 5 4 3 2 1 0 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: ? bit 15 (dual-cas or dual-we select bit (cw2)): when accessing a 16-bit bus width space, cw2 selects the dual-cas or the dual-we method. when cleared to 0, the cash , casl , and wrl signals are valid ; when set to 1, the casl , wrh , and wrl signals are valid. when accessing an 8-bit space, only casl and wrl signals are valid, regardless of the cw2 setting. bit 15l: cw2 description 0 dual-cas: cash , casl , and wrl signals are valid (initial value) 1 dual-we: casl , wrh , and wrl signals are valid ? bit 14 (ras down (rasd)): when dram access pauses, rasd determines whether to keep ras low while waiting for the next dram access (ras down mode) or return it to high (ras up mode). when cleared to 0, the ras signal returns to high; when set to 1, it stays low. bit 14: rasd description 0 ras up mode: return ras signal to high and wait for the next dram access (initial value) 1 ras down mode: keep ras signal low and wait for the next dram access ? bit 13 (ras precharge cycle count (tpc)): tpc selects whether the ras signal precharge cycle (tp) will be 1 state or 2. when tpc is cleared to 0, a 1-state precharge cycle is inserted; when 1 is set, a 2-state precharge cycle is inserted. bit 13: tpc description 0 1-state precharge cycle inserted (initial value) 1 2-state precharge cycle inserted ? bit 12 (burst operation enable (be)): be selects whether or not to perform burst operation, a high-speed page mode. when burst operation is not selected (0), the row address is not compared but instead is transferred to the dram every time and full access is performed. when burst operation is selected (1), row addresses are compared and burst operation with the same row address as previously is performed (in this access, no row address is output and the column address and cas signal alone are output) (high-speed page mode).
116 bit 12: be description 0 normal mode: full access (initial value) 1 burst operation: high-speed page mode ? bit 11 (cas duty (cdty)): cdty selects 35% or 50% of the tc state as the high-level duty ratio of the signal cas in short-pitch access. when cleared to 0, the cas signal high level duty is 50%; when set to 1, it is 35%. bit 11: cdty description 0 cas signal high level duty cycle is 50% of the t c state (initial value) 1 cas signal high level duty cycle is 35% of the t c state ? bit 10 (multiplex enable bit (mxe)): mxe determines whether or not dram row and column addresses are multiplexed. when cleared to 0, addresses are not multiplexed; when set to 1, they are multiplexed. bit 10: mxe description 0 multiplexing of row and column addresses disabled (initial value) 1 multiplexing of row and column addresses enabled ? bits 9 and 8 (multiplex shift count 1 and 0 (mxc1 and mxc0)): shift row addresses downward by a certain number of bits (8?0) when row and column addresses are multiplexed (mxe = 1). regardless of the mxe bit setting, these bits also select the range of row addresses compared in burst operation. bit 9: mxc1 bit 8: mxc0 row address shift (mxe = 1) row address bits compared (in burst operation) (mxe = 0 or 1) 0 0 8 bits (initial value) a8?27 (initial value) 1 9 bits a9?27 1 0 10 bits a10?27 1 reserved reserved ? bits 7? (reserved): these bits are always read as 0. the write value should always be 0.
117 8.2.6 refresh control register (rcr) the refresh control register (rcr) is a 16-bit read/write register that controls the start of refresh- ing and selects the refresh mode and the number of wait states during refreshing. it is initialized to h'0000 by a power-on reset, but is not initialized by a manual reset or in standby mode. to prevent rcr from being written incorrectly, it must be written by a different method from most other registers. a word transfer operation is used, h'5a is written in the upper byte, and the actual data is written in the lower byte. for details, see section 8.2.11, notes on register access. bit: 15 14 13 12 11 10 9 8 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: bit: 7 6 5 4 3 2 1 0 bit name: rfshe rmode rlw1 rlw0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w ? bit 15? (reserved): these bits are always read as 0. ? bit 7 (refresh control (rfshe)): rfshe determines whether or not to perform dram refresh operations. when this bit is cleared to 0, no dram refresh control is performed and the refresh timer counter (rtcnt) can be used as an 8-bit interval timer. when set to 1, dram refresh control is performed. bit 7: rfshe description 0 refresh control disabled. rtcnt can be used as an 8-bit interval timer (initial value) 1 refresh control enabled ? bit 6 (refresh mode (rmode)): when dram refresh control is selected (rfshe = 1), rmode selects whether to perform cas-before-ras (cbr) refresh or self-refresh. when this bit is cleared to 0, a cbr refresh is performed at the cycle set in the refresh timer control/status register (rtcsr) and refresh time constant register (rtcor). when set to 1, the dram performs a self-refresh. when refresh control is not selected (rfshe = 0), the rmode bit setting is not valid. when canceling self-refresh, set rmode to 0 with rfshe set to 1.
118 bit 6: rmode description 0 cas-before-ras refresh (initial value) 1 self-refresh ? bits 5 and 4?br refresh wait state insertion bits 1 and 0 (rlw1, rlw0): these bits select the number of wait states to be inserted (1?) during cas-before-ras refreshing. when cbr refresh is performed and the rw1 bit in wcr1 is set to 1, the number of wait states selected by rlw1 and rlw0 is inserted regardless of the wait signal. when the rw1 bit is cleared to 0, the rlw1 and rlw0 bit settings are ignored and no wait states are inserted. bit 5: rlw1 bit 4: rlw0 description 0 0 1 state inserted (initial value) 1 2 states inserted 1 0 3 states inserted 1 4 states inserted ? bits 3? (reserved): these bits are always read as 0. the write value should always be 0. 8.2.7 refresh timer control/status register (rtcsr) the refresh timer control/status register (rtcsr) is a 16-bit read/write register that selects the clock input to the refresh timer counter (rtcnt) and controls compare match interrupts (cmi). it is initialized to h'0000 by a power-on reset, but is not initialized by a manual reset or in standby mode. to prevent rtcsr from being written incorrectly, it must be written by a different method from most other registers. a word transfer operation is used, h'a5 is written in the upper byte, and the actual data is written in the lower byte. for details, see section 8.2.11, notes on register access. bit: 15 14 13 12 11 10 9 8 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: bit: 7 6 5 4 3 2 1 0 bit name: cmf cmie cks2 cks1 cks0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w
119 ? bits 15? (reserved): these bits are always read as 0. ? bit 7 (compare match flag (cmf)): indicates whether the values of rtcnt and the refresh time constant register (rtcor) match. when 0, the value of rtcnt and rtcor do not match; when 1, the value of rtcnt and rtcor match. bit 7: cmf description 0 rtcnt value does not equal rtcor value (initial value) to clear cmf, the cpu must read cmf after it has been set to 1, then write a 0 in this bit 1 rtcnt value is equal to rtcor value ? bit 6 (compare match interrupt enable (cmie)): enables or disables the compare match interrupt (cmi) generated when cmf is set to 1 in rtcsr (rtcnt value = rtcor value). when cleared to 0, the cmi interrupt is disabled; when set to 1, it is enabled. bit 6: cmie description 0 compare match interrupt request (cmi) is disabled (initial value) 1 compare match interrupt request (cmi) is enabled ? bits 5? (clock select bits 2? (cks2?ks0)): these bits select the clock input to rtcnt from among the seven types of clocks created by dividing the system clock ( ). when the input clock is selected with the cks2?ks0 bits, rtcnt starts to increment. bit 5: cks2 bit 4: cks1 bit 3: cks0 description 0 0 0 clock input disabled (initial value) 1 /2 10 /8 1 /32 100 /128 1 /512 10 /2048 1 /4096 ? bits 2? (reserved): these bits are always read as 0. the write value should always be 0.
120 8.2.8 refresh timer counter (rtcnt) the refresh timer counter (rtcnt) is a 16-bit read/write register that is used as an 8-bit upcounter that generates refresh or interrupt requests. when the input clock is selected by clock select bits 2 0 (cks2?ks0) in rtcsr, that clock makes the rtcnt start incrementing. when the values of rtcnt and the refresh time constant register (rtcor) match, rtcnt is cleared to h'0000 and the cmf flag in rtcsr is set to 1. when the rfshe bit in rcr is also set to 1, a cas-before- ras refresh is performed. when the cmie bit in rtcsr is also set to 1, a compare match interrupt (cmi) is generated. bits 15? are reserved and are not incremented. these bits are always read as 0. rtcnt is initialized to h'0000 by a power-on reset, but is not initialized by a manual reset or in standby mode. to prevent rtcsr from being written incorrectly, it must be written by a different method from most other registers. a word transfer operation is used, h'69 is written in the upper byte, and the actual data is written in the lower byte. for details, see section 8.2.11, notes on register access. bit: 15 14 13 12 11 10 9 8 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: bit: 7 6 5 4 3 2 1 0 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w 8.2.9 refresh time constant register (rtcor) the refresh time constant register (rtcor) is a 16-bit read/write register that sets the compare match cycle used with rtcnt. the values in rtcor and rtcnt are constantly compared. when they match, the compare match flag (cmf) is set in rtcnt and rtcsr is cleared to h'0000. if the rfshe bit in rcr is set to 1 when this happens, a cas-before-ras (cbr) refresh is performed. when the cmie bit in rtcsr is also set to 1, a compare match interrupt (cmi) is generated. bits 15? are reserved and cannot be used to set the cycle. these bits are always read as 0.
121 rtcor is initialized to h'00ff by a power-on reset, but is not initialized by a manual reset or in standby mode. to prevent rtcor from being written incorrectly, it must be written by a different method from most other registers. a word transfer operation is used, h'96 is written in the upper byte, and the actual data is written in the lower byte. for details, see section 8.2.11, notes on register access. bit: 15 14 13 12 11 10 9 8 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: bit: 7 6 5 4 3 2 1 0 bit name: initial value: 1 1 1 1 1 1 1 1 r/w: r/w r/w r/w r/w r/w r/w r/w r/w 8.2.10 parity control register (pcr) the parity control register (pcr) is a 16-bit read/write register that selects the parity polarity and space to be parity checked. pcr is initialized to h'0000 by a power-on reset, but is not initialized by a manual reset or in standby mode. bit: 15 14 13 12 11 10 9 8 bit name: pef pfrc peo pchk1 pchk0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: initial value: 0 0 0 0 0 0 0 0 r/w:
122 ? bit 15 (parity error flag (pef)): when a parity check is carried out, pef indicates whether a parity error has occurred. 0 indicates that no parity error has occurred; 1 indicates that a parity error has occurred. bit 15: pef description 0 no parity error (initial value) cleared by reading pef after it has been set to 1, then writing 0 in pef 1 parity error has occurred ? bit 14 (parity output force (pfrc)): pfrc selects whether to produce a forced parity output for testing the parity error check function. when cleared to 0, there is no forced output; when set to 1, it produces a forced high-level output from the dph and dpl pins when data is output, regardless of the parity. bit 14: pfrc description 0 parity output not forced (initial value) 1 high output forced ? bit 13 (parity polarity (peo)): peo selects even or odd parity. when cleared to 0, parity is even; when set to 1, parity is odd. bit 13: peo description 0 even parity (initial value) 1 odd parity ? bits 12 and 11 (parity check enable bits 1 and 0 (pchk1 and pchk0)): these bits determine whether or not parity is checked and generated, and select the check and generation spaces. bit 12: pchk1 bit 11: pchk0 description 0 0 parity not checked and not generated (initial value) 1 parity checked and generated only in dram area 1 0 parity checked and generated in dram area and area 2 1 reserved ? bits 10? (reserved): these bits are always read as 0. the write value should always be 0.
123 8.2.11 notes on register access rcr, rtcsr, rtcnt, and rtcor differ from other registers in being more difficult to write. data requires a password when it is written. this prevents data from being mistakenly overwritten by program overruns and so on. writing to rcr, rtcsr, rtcnt, and rtcor: use only word transfer instructions. it is not possible to write with byte transfer instructions. as figure 8.2 shows, when writing to rcr, place h'5a in the upper byte and the write data in the lower byte. when writing to rtcsr, place h'a5 in the upper byte and the write data in the lower byte. when writing to rtcnt, place h'69 in the upper byte and the write data in the lower byte. when writing to rtcor, place h'96 in the upper byte and the write data in the lower byte. these transfers write data in the lower byte of the respective registers. if the upper byte differs from the above passwords, no writing occurs. h'5a write data rcr 15 0 87 h'a5 write data rtcsr 15 0 87 h'69 write data rtcnt 15 0 87 h'96 write data rtcor 15 0 87 figure 8.2 writing to rcr, rtcsr, rtcnt, and rtcor reading from rcr, rtcsr, rtcnt, and rtcor: these registers are read like other registers. they can be read by byte and word transfer instructions. if read by word transfer, the value of the upper eight bits is h'00.
124 8.3 address space subdivision 8.3.1 address spaces and areas figure 8.3 shows the address format used in this chip. a0 a21 a23,a22 a26 a24 a31 a28 a27 output address: output from address pins a21 a0 ignored: only valid when the address multiplex function is being used in the dram space (area 1); not output in other cases. when not output, becomes shadow. area selection: decoded to become chip select signals cs0 cs7 7 basic bus width selection: not output externally, but used for basic bus width selection when 0, (h'0000000 h'7ffffff), the basic bus width is 8 bits. when 1, (h'8000000 h'fffffff), the basic bus width is 16 bits. ignored: always ignored, not output externally 4-gbyte space 16-mbyte space 4-mbyte space 128-mbyte space figure 8.3 address format since this chip uses a 32-bit address, 4 gbytes of space can be accessed in the architecture; however, the upper 4 bits (a31?28) are always ignored and not output. bit a27 is basically only used for switching the bus width. when the a27 bit is 0 (h'0000000?'7ffffff), the bus width is 8 bits; when the a27 bit is 1 (h'8000000?'fffffff), the bus width is 16 bits. with the remaining 27 bits (a26?0), a total of 128 mbytes can thus be accessed. the 128-mbyte space is subdivided into 8 areas (areas 0?) of 16 mbytes each according to the values of bits a26?24. the space with bits a26?24 as 000 is area 0 and the space with bits a26?24 as 111 is area 7. the a26?24 bits are decoded and are output as the chip select signals ( cs0 cs7 ) of the corresponding areas 0?. table 8.7 shows how the space is divided.
125 table 8.7 how space is divided area address assignable memory capacity (linear space) bus width cs output 0 h'0000000 h'0ffffff on-chip rom * 1 64 kb 32 external memory * 2 4 mb 8/16 * 3 cs0 h'1ffffff external memory 4 mb 8 cs1 * 4 16 mb 8 ras cas h'2ffffff external memory 4 mb 8 cs2 h'3ffffff external memory 4 mb 8 cs3 h'4ffffff external memory 4 mb 8 cs4 h'5ffffff on-chip supporting modules 512 b 8/16 * 5 6 h'6000000 h'6ffffff external memory * 7 4 mb 8/16 * 6 cs6 h'7ffffff external memory 4 mb 8 cs7 h'8ffffff on-chip rom * 1 64 kb 32 external memory * 2 4 mb 8/16 * 3 cs0 h'9ffffff external memory 4 mb 16 cs1 * 4 16 mb 16 ras cas h'affffff external memory 4 mb 16 cs2 h'bffffff external memory 4 mb 16 cs3 h'cffffff external memory 4 mb 16 cs4 h'dffffff external memory 4 mb 16 cs5 h'effffff external memory 4 mb 16 cs6 h'fffffff on-chip ram 8 kb * 8 , 4 kb * 9 32 notes: * 1 when md2 md0 pins are 010 (sh7034) * 2 when md2 md0 pins are 000 or 001 * 3 select with md0 pin * 4 select with drame bit in bcr * 5 divided into 8-bit and 16-bit space according to value of address bit a8. (longword accesses are inhibited, however, for on-chip supporting modules with bus widths of 8 bits. some on-chip supporting modules with bus widths of 16 bits also have registers that are only byte-accessible and registers for which byte access is inhibited. for details, see the sections on the individual modules.) * 6 divided into 8-bit space and 16-bit space by value of address bit a14 * 7 select with ioe bit in bcr * 8 for sh7032 * 9 for sh7034
126 as figure 8.4 shows, specific spaces such as dram space and address/data multiplexed i/o space are allocated to the 8 areas. each of the spaces is equipped with the necessary interfaces. the control signals needed by dram and peripheral chips will be output by the chip to devices connected to an area allocated to the appropriate type of space. 8.3.2 bus width the primary bus width selection for this chip is made by switching between 8 bits and 16 bits using the a27 bit. when a27 is 0, the bus width is 8 bits and data is input/output through the ad7?d0 pins; when a27 is 1, the size is 16 bits and data is input/output through the ad15 ad0 pins for word accesses. for byte access, the upper byte is input/output through ad15?d8 and the lower byte through ad7?d0. when the bus width is 8 bits or byte access is being performed with a 16-bit bus width, the status of the eight ad pins that are not inputting/outputting data is as shown in appendix b, pin states. bus widths are also determined by conditions other than the a27 bit for specific areas: ? area 0 is an 8-bit external memory space when the md2?d0 pins are 000, a 16-bit external memory space when these bits are 001, and a 32-bit on-chip rom space when they are 010 (the on-chip rom is available only in the sh7034). ? area 5 is an 8-bit on-chip supporting module space when the a27 bit and a8 bit are both 0 and a 16-bit on-chip supporting module space when the a27 bit is 0 and the a8 bit is 1. when the a27 bit is 1, it is a 16-bit external memory space. ? area 6 has an 8-bit bus width when the a27 bit and a14 bit are both 0 and a 16-bit bus width when the a27 bit is 0 and the a14 bit is 1. when the a27 bit is 1, it is a 16-bit space. ? area 7 is a 32-bit on-chip ram space when the a27 bit is 1 and an 8-bit external memory space when the a27 bit is 0. word (16-bit) data accessed from 8-bit bus areas and longword (32-bit) data accessed from 16-bit bus areas require two consecutive accesses. longword (32-bit) data accessed from 8-bit bus areas requires four consecutive accesses. 8.3.3 chip select signals ( cs0 cs7 ) when the a26?24 bits of the address are decoded, they become chip select signals ( cs0 cs7 ) for areas 0?. when an area is accessed, the corresponding chip select pin is driven low. table 8.8 shows the relationship between the a26?24 bits and the chip select signals.
127 table 8.8 a26?24 bits and chip select signals address a26 a25 a24 area selected chip select pin driven low 0 0 0 area 0 cs0 cs1 cs2 cs3 cs4 cs5 cs6 cs7 the chip select signal is output only for external accesses. when accessing the on-chip rom (area 0), on-chip supporting modules (area 5), and on-chip ram (area 7), the cs0 , cs5 , and cs7 pins are not driven low. when accessing dram space (area 1), select the ras and cas signals with the pin function controller. 8.3.4 shadows the size of each area is 16 mbytes, which can be specified with the 24 address bits a23?0 for 8- bit spaces and 16-bit spaces alike. bits a23 and a22, however, output externally only when the address multiplex function is used in dram space (area 1); in all other cases, there is no output, so the actually accessible area for all areas is the 4 mbytes that can be specified with the 22 bits a21?0. regardless of the values of a23 and a22, the same 4 mbytes of actual space is accessed. as illustrated in figure 8.4 (a), the a23 and a22 bit regions 00, 01, 10 and 11 are called shadows of actual areas. shadows are allocated in 4-mbyte units for both 8-bit and 16-bit bus widths. when the same addresses h'3200000, h'3600000, h'3a00000 and h'3e00000 are specified for values a21?0, as shown in figure 8.4 (b), the same actual space is accessed regardless of the a23 and a22 bits. in areas whose bus widths are switchable using the a27 address bit, the shadow of the same actual space is allocated to both a27 = 0 spaces and a27 = 1 spaces (figure 8.4(a)). when the value of a27 is changed, the valid ad pins switch from ad15?d0 to ad7?d0, but the actual space accessed remains the same. the spaces of on-chip rom (area 0), dram (area 1), on-chip supporting modules (area 5), and on-chip ram (area 7) have shadows of different sizes from those mentioned above. see section 8.3.5, area descriptions, for details.
128 logical address space h'b000000 h'3000000 actual space area accessible with a21 a0 4 mbytes shadow (a23, a22 = 00) shadow (a23, a22 = 01) shadow (a23, a22 = 10) shadow (a23, a22 = 11) h'b3fffff h'b400000 h'3400000 h'b7fffff h'b800000 h'bbfffff h'bc00000 h'bffffff h'3800000 h'3c00000 16-bit space 8-bit space h'33fffff h'37fffff h'3bfffff actual space location actually accessed logical address space location indicated by address location indicated by address location indicated by address location indicated by address 8-bit space h'3000000 h'3200000 h'33fffff h'3400000 h'3600000 h'3a00000 h'3e00000 h'37fffff h'3800000 h'3bfffff h'3c00000 h'3ffffff a. shadow allocation b. actual space accessed when addresses are specified h'3ffffff figure 8.4 shadows
129 8.3.5 area descriptions area 0: area 0 is an area with address bits a26?24 set to 000 and an address range of h'0000000?'0ffffff and h'8000000?'8ffffff. figure 8.5 shows a memory map of area 0. area 0 can be set for use as on-chip rom space or external memory space with the mode pins (md2?d0). the md2?d0 pins also determine the bus width, regardless of the a27 address bit. when md2?d0 are 000, area 0 is an 8-bit external memory space; when they are 001, area 0 is a 16-bit external memory space; and when they are 010, it is a 32-bit on-chip rom space. in the sh7032, area 0 can only be used as external memory space since there is no on-chip rom, and this last setting is meaningless. the capacity of the on-chip rom is 64 kbytes, so bits a23?16 are ignored in on-chip rom space and the shadow is in 64-kbyte units. the cs0 signal is disabled. in external memory space, the a23 and a22 bits are not output and the shadow is in 4-mbyte units. when external memory space is accessed, the cs0 signal is valid. the external memory space has a long wait function, so between 1 and 4 states can be selected for the number of long waits inserted into the bus cycle using the area 0 and 2 long wait insertion bits (a02lw1, a02lw0) of wait state controller 3 (wcr3).
130 h'8000000 h'83fffff h'8400000 h'87fffff h'8800000 h'8bfffff h'8c00000 h'8ffffff h'0000000 h'0400000 h'0800000 h'0c00000 h'03fffff h'07fffff h'0bfffff shadow shadow shadow shadow 8 or 16 bit space md2 md0 = 000 or 001 md2 md0 = 010 h'8000000 h'800ffff h'8ff0000 h'8ffffff on-chip rom (64 kbytes) valid addresses a15 a0 (a23 a16 ignored) cs0 on-chip rom space valid in sh7034 only shadow shadow h'8010000 shadow shadow shadow shadow actual space logical address space logical address space h'0ffffff h'0ffffff 32-bit space h'0ff0000 32-bit space actual space md2 md0 = 000: 8-bit access, 001: 16-bit access valid addresses a21 a0 (a23 and a22 not output) cs0 long wait function h'0000000 h'000ffff h'0010000 8 or 16 bit space external memory space (4 mbytes) note: the bus width of area 0 is determined by the md2 md0 pins regardless of the a27 bit setting. figure 8.5 memory map of area 0 area 1: area 1 is an area with address bits a26?24 set to 001 and an address range of h'1000000?'1ffffff and h'9000000?'9ffffff. figure 8.6 shows a memory map of area 1. area 1 can be set for use as dram space or external memory space with the dram enable bit (drame) in the bus control register (bcr). when the drame bit is 0, area 1 is external memory space; when drame is 1, it is dram space. in external memory space, the bus width is 8 bits when the a27 bit is 0 and 16 bits when it is 1. bits a23 and a22 are not output and the shadow is in 4-mbyte units. when external memory is accessed, the cs1 signal is valid. dram space is a type of external memory space, but it is configured especially to be connected to dram, so it outputs strobe signals required for this purpose. the access size is 8 bits when address bit a27 is 0 and 16 bits when a27 is 1. when the multiplex enable bit (mxe) in the
131 dram control register (dcr) is set to 1 to use the address multiplex function, bits a23?0 are multiplexed and output from pins a15?0, so a maximum 16-mbyte space can be used. when dram space is accessed, the cs1 signal is not valid and the pin function controller should be set for access with cas ( cash and casl ) and ras signals. h'9000000 h'93fffff h'9400000 h'97fffff h'9800000 h'9bfffff h'9c00000 h'9ffffff h'1000000 h'1400000 h'1800000 h'1c00000 h'13fffff h'17fffff h'1bfffff h'1ffffff shadow shadow shadow external memory space (4 mbytes) a27 = 0: 8-bit space valid address a21 a0 (a23 and a22 not output) cs1 multiplexed (mxe = 1): 16-bit space not multi- plexed (mxe = 0): 4-mbyte space cs1 cas ras figure 8.6 memory map of area 1 areas 2?: areas 2? are areas with address bits a26?24 set to 010, 011, and 100, respectively, and address ranges of h'2000000?'2ffffff and h'a000000?'affffff (area 2), h'3000000 h'3ffffff and h'b000000?'bffffff (area 3), and h'4000000?'4ffffff and h'c000000 h'cffffff (area 4). figure 8.7 shows a memory map of area 2, which is representative of areas 2?.
132 areas 2? are always used as external memory space. the bus width is 8 bits when the a27 bit is 0 and 16 bits when it is 1. a23 and a22 bits are not output and the shadow is in 4-mbyte units. when areas 2? are accessed, the cs2 , cs3 , and cs4 signals are valid. area 2 has a long wait function, so between 1 and 4 states can be selected for the number of long waits inserted into the bus cycle using bits a02lw1 and a02lw0 in wcr3. h'a000000 h'a3fffff h'a400000 h'a7fffff h'a800000 h'abfffff h'ac00000 h'affffff h'2000000 h'2400000 h'2800000 h'2c00000 h'23fffff h'27fffff h'2bfffff h'2ffffff shadow shadow shadow shadow external memory space (4 mbytes) logical address space 16-bit space 8-bit space actual space valid addresses a21 a0 (a23 and a22 not output) cs2 long wait function figure 8.7 memory map of area 2
133 area 5: area 5 is an area with address bits a26?24 set to 101 and an address range of h'5000000?'5ffffff and h'd000000?'dffffff. figure 8.8 shows a memory map of area 5. area 5 is allocated to on-chip supporting module space when the a27 address bit is 0 and external memory space when a27 is 1. in on-chip supporting module space, bits a23?9 are ignored and the shadows are in 512-byte units. the bus width is 8 bits when the a8 bit is 0 and 16 bits when a8 is 1. when on-chip supporting module space is accessed, the cs5 signal is not valid. in external memory space, the a23 and a22 bits are not output and the shadow is in 4-mbyte units. the bus width is always 16 bits. when external memory space is accessed, the cs5 signal is valid. h'd000000 h'd400000 h'd800000 h'dc00000 h'd3fffff h'd7fffff h'dbfffff h'dffffff shadow shadow shadow shadow external memory space (4 mbytes) h'5000000 h'5ffffff shadow shadow actual space shadow shadow shadow shadow h'5fffe00 h'50001ff logical address space 8 or 16-bit space on chip peripheral module space (512 bytes) a8 = 0: 8-bit space a8 = 1: 16-bit space * ignored addresses: a23 a9 (valid addresses a8 a0) cs5 valid addresses a21 a0 a23 and a22 not output) cs5 figure 8.8 memory map of area 5
134 area 6: area 6 is an area with address bits a26 a24 set to 110 and an address range of h'6000000 h'6ffffff and h'e000000 h'effffff. figure 8.9 shows a memory map of area 6. in area 6, a space for which address bit a27 is 0 is allocated to address/data multiplexed i/o space when the multiplexed i/o enable bit (ioe) of the bus control register (bcr) is 1, and to external memory space when the ioe bit is 0. when a27 is 1, it is always external memory space. the multiplexed i/o space is a type of external memory space but the address and data are multiplexed and output from ad15 ad0 or ad7 ad0. the bus width is 8 bits when the a14 bit is 0 and 16 bits when the a14 bit is 1. the a23 and a22 bits are not output and the shadow is in 4- mbyte units. when multiplexed i/o space is accessed, the cs6 cs6 ioe = 1: address/data multiplexed i/o space; ioe = 0: external memory space a14 = 0: 8-bit space a14 = 1: 16-bit space valid addresses a21 a0 (a23 and a22 not output) cs6 long wait function valid addresses a21 a0 (a23 and a22 not output) cs6 long wait function figure 8.9 memory map of area 6
135 area 7: area 7 is an area with address bits a26 a24 set to 111 and an address range of h'7000000 h'7ffffff and h'f000000 h'fffffff. figure 8.10 shows a memory map of area 7. area 7 is allocated to external memory space when a27 is 0 and on-chip ram space when a27 is 1. in external memory space, the bus width is 8 bits. the a23 and a22 bits are not output and the shadow is in 4-mbyte units. when external memory is accessed, the cs7 a13 are ignored and the shadows are in 8-kbyte units. in the sh7034, the on-chip ram capacity is 4 kbytes, so a23 a12 are ignored and the shadows are in 4-kbyte units. during on-chip ram access, the cs7 on-chip ram space sh7032: 8 kbytes, sh7034: 4 kbytes valid addresses sh7032: a12 a0 (a23 a13 not output) sh7034: a11 a0 (a23 a12 not output) cs7 valid addresses a21 a0 (a23 and a22 not output) cs7 figure 8 10 memory map of area 7
136 8.4 accessing external memory space in external memory space, a strobe signal is output based on the assumption of a directly connected sram. the external memory space is allocated to the following areas: ? md0 are 000 or 001) ? ? 4 ? ? ? 8.4.1 basic timing the bus cycle for external memory space access is 1 or 2 states. the number of states is controlled with wait states by the settings of wait state control registers 1 3 (wcr1 wcr3). for details, see section 8.4.2, wait state control. figures 8.11 and 8.12 illustrate the basic timing of external memory space access. t1 ck a21 a0 csn rd (read) ad15 ad0 (read) figure 8.11 basic timing of external memory space access (1-state read timing)
137 t1 ck a21 a0 csn rd ad0 t2 wrh wrl ad0 read write when rddty = 0 when rddty = 1 figure 8.12 basic timing of external memory space access (2-state read timing) high-level duties of 35% and 50% can be selected for the rd
138 8.4.2 wait state control the number of external memory space access states and the insertion of wait states can be controlled using the wcr1 wcr3 bits. the bus cycles that can be controlled are the cpu read cycle and the dmac dual mode read cycle. the bus cycle that can be controlled using the wcr2 is the dmac single-mode read/write cycle. table 8.9 shows the number of states and number of wait states in access cycles to external memory spaces. table 8.9 number of states and number of wait states in access cycles to external memory spaces cpu read cycle, dmac dual mode read cycle, dmac single mode read/write cycle area corresponding bits in wcr1 and wcr2 = 0 corresponding bits in wcr1 and wcr2 = 1 1, 3 5, 7 1 cycle fixed; wait wait wait wait wait 5, and 7 are cleared to 0 and the wait wait wait wait * 2
139 t1 ck a21 a0 csn rd ad0 wrh wrl ad0 read write wait figure 8.13 wait state timing for external memory space access (2 states plus wait states from wait signal) areas 0, 2, and 6 have long wait functions. when the corresponding bits in wcr1 and wcr2 are cleared to 0, the access cycle is 1 state plus the number of long wait states (set in wcr3, selectable between 1 and 4) and the wait wait wait wait
140 t1 ck a21 a0 csn rd ad0 wrh wrl ad0 write wait wait figure 8.14 wait state timing for external memory space access (1 state plus long wait state (when set to insert 3 states) plus wait states from wait signal) for cpu write cycles and dmac dual mode write cycles to external memory space, the number of states and wait state insertion cannot be controlled by wcr1. in areas 1, 3, 4, 5, and 7, the wait wait wait 2 and 0 of wcr1; only write 1. when area 1 is being used as external memory space, do not write 0 in bit 1 (ww1); always write 1.
141 8.4.3 byte access control the upper byte and lower byte control signals when 16-bit bus width space is being accessed can be selected from ( wrh wrl wr hbs lbs wrh wrl wr lbs hbs wrh wrl hbs lbs wr figure 8.15 byte access control timing for external memory space access (write cycle) the wrh wrl hbs lbs hbs wrh lbs wrl wr hbs wrl wr wr wrh lbs
142 8.5 dram interface operation when the dram enable bit (drame) in bcr is set to 1, area 1 becomes dram space and the dram interface function is available, which permits direct connection of this chip to drams. 8.5.1 dram address multiplexing when the multiplex enable bit (mxe) in the dram area control register (dcr) is set to 1, row addresses and column addresses are multiplexed. this allows drams that require multiplexing of row and column addresses to be connected directly to an sh microprocessor without additional multiplexing circuits. when addresses are multiplexed (mxe = 1), setting of the dcr s multiplex shift bits (mxc1, mxc0) allows selection of eight, nine and ten-bit row address shifting. table 8.10 illustrates the relationship between the mxc1/mxc0 bits and address multiplexing.
143 table 8.10 relationship between multiplex shift count bits (mxc1, mxc0) and address multiplexing 8-bit shift 9-bit shift 10-bit shift output pin output row address output column address output row address output column address output row address output column address a21 undefined a21 undefined a21 undefined a21 a20 value a20 value a20 value a20 a19 a19 a19 a19 a18 a18 a18 a18 a17 a17 a17 a17 a16 a16 a16 a16 a15 a23 a15 a15 a15 a14 a22 a14 a23 a14 a14 a13 a21 a13 a22 a13 a23 a13 a12 a20 a12 a21 a12 a22 a12 a11 a19 a11 a20 a11 a21 a11 a10 a18 a10 a19 a10 a20 a10 a9 a17 a9 a18 a9 a19 a9 a8 a16 a8 a17 a8 a18 a8 a7 a15 a7 a16 a7 a17 a7 a6 a14 a6 a15 a6 a16 a6 a5 a13 a5 a14 a5 a15 a5 a4 a12 a4 a13 a4 a14 a4 a3 a11 a3 a12 a3 a13 a3 a2 a10 a2 a11 a2 a12 a2 a1 a9 a1 a10 a1 a11 a1 a0 a8 a0 a9 a0 a10 a0 note: the mxc1=1, mx0=1 setting is reserved, and must not be used.
144 for example, when mxc1 and mxc0 are set to 00 and an 8-bit shift is selected, the a23 a8 address bit values are output to pins a15 a0 the row address. the values for a21 a16 are undefined. the values of bits address a21 a0 are output to pins a21 a0 as the column address. figure 8.16 depicts address multiplexing with an 8-bit shift. a23 a8 a7 a0 a21 a16 a15 a0 a23 a22 a21 a0 a21 a0 ras cas figure 8.16 address multiplexing states (8-bit shift) 8.5.2 basic timing there are two types of dram accesses: short pitch and long pitch. short pitch or long pitch can be selected for the respective bus cycles using the rw1 and ww1 bits in wcr1 and the drw1 and dww1 bits in wcr2. when the corresponding bits are cleared to 0, dram access is short pitch and column address output occurs in 1 state. when these bits are 1, dram access is long pitch and column address output occurs in 2 states. figure 8.17 shows short pitch timing; figure 8.18 shows long pitch timing. the high-level duty of the cas
145 ck a21 a0 ras cas wrh wrl ad0 t p write wrh wrl ad0 read t r t c cdty = 0 cdty = 1 row address column address figure 8.17 short pitch access timing
146 ck a21 a0 ras cas wrh wrl ad0 t p write wrh wrl ad0 read t r t c 1 row address column address t c 2 figure 8.18 long pitch access timing 8.5.3 wait state control precharge state control: when the microprocessor clock frequency is raised and the cycle period shortened, 1 cycle may not always be sufficient for the precharge time for the ras ras
147 t p 1 t p 2 t r t c 1 t c 2 row address column address ck a21 a0 ras cas figure 8.19 precharge timing (long pitch) control of insertion of wait states using the wait pin input signal: the number of wait states inserted into the dram access cycle can be controlled by setting wcr1 and wcr2. when the corresponding bits in wcr1 and wcr2 are cleared to 0, the column address output cycle ends in 1 state and no wait states are inserted. when the bit is 1, the wait a0 ras cas wait figure 8.20 wait state timing during dram access (long pitch) when the rw1 bit is set to 1, the number of wait states selected by cbr refresh wait state insertion bits 1 and 0 (rlw1, rlw0) in the refresh control register (rcr) are inserted into the cas-before-ras refresh cycle.
148 8.5.4 byte access control 16-bit width and 18-bit width drams require different types of byte control signals for access. by setting the dual cas signals/dual we signals select bit (cw2) in dcr, the bsc allows selection of either the dual cas signal or dual we signal system of control signals. when 16-bit space is being accessed and the cw2 bit is cleared to 0 for dual cas signals, cash casl wrl casl wrh wrl wrl casl
149 t p t r t c row address column address ck a21 a0 ras cash casl wrh wrl a0 ras cash casl wrh wrl figure 8.21 byte access control timing for dram access (upper byte write cycle, short pitch)
150 8.5.5 dram burst mode in addition to the normal mode of dram access, in which row addresses are output at every access and data then accessed (full access), the dram also has a high-speed page mode for use when continuously accessing the same row. the high speed page mode enables fast access of data simply by changing the column address after the row address is output (burst mode). select between full access and burst operation by setting the burst enable bit (be)) in dcr. when the be bit is set to 1, burst operation is performed when the row address matches the previous dram access row address. figure 8.22 shows a comparison between full access and burst operation. ras cas ad0 ras cas a0 ad15 ad0 a21 a0 row address 1 column address 1 row address 2 column address 2 data 1 data 2 row address 1 column address 1 column address 2 column address 3 column address 4 data 1 data 2 data 3 data 4 (a) full access (read cycle) (b) burst operation (read cycle) figure 8.22 full access and burst operation short pitch high-speed page mode or long pitch high-speed page mode burst transfers can be selected independently for dram read/write cycles even when burst operation is selected by using the bits corresponding to area 1 in wcr1 and wcr2 (rw1, ww1, drw1, dww1). ras down mode or ras up mode can be selected by setting the ras down bit (rasd) in dcr when there is an access outside the dram space during burst operation.
151 short-pitch, high-speed page mode and long-pitch high-speed page mode: when burst operation is selected by setting the be bit to 1 in dcr, short pitch high-speed page mode or long pitch high-speed page mode can be selected by setting the rw1, ww1, drw1, and dww1 bits in wcr1 and wcr2. ? cas wait a0 ras cas data 4 data 3 data 2 data 1 t c t c wr ad15 a0 column address 1 column address 2 column address 3 column address 4 row address 1 figure 8.23 short-pitch, high-speed page mode (read cycle) when the write cycle continues for the same row address in short-pitch, high-speed page mode, an open cycle (silent cycle) is produced for 1 cycle only. this timing is shown in figure 8.24. likewise, when a write cycle continues after the read cycle for the same row address, a silent cycle is produced for 1 cycle. this timing is shown in figure 8.25. note also that when dram is written to in short-pitch, high-speed page mode when using dmac single address mode, a silent cycle is inserted in each transfer. the details of timing are discussed in sections 20.1.3 (3) and 20.2.3 (3), bus timing.
152 t p t r t c t c ck a21 a0 ras cas wr a0 silent cycle access a access b row address column address a-1 column address a-2 column address b-1 column address b-2 note: accesses a and b are examples of 32-bit data accesses in their respective 16-bit bus width spaces. figure 8.24 short-pitch, high-speed page mode (write cycle) t p t r t c t c ck a21 a0 ras cas wr ad0 silent cycle access a (read) access b (write) column address a-1 column address a-2 column address b-1 column address b-2 read data a-1 read data a-2 write data b-1 write data b-2 row address note: accesses a and b are examples of 32-bit data accesses in their respective 16-bit bus width spaces. figure 8.25 short-pitch, high-speed page mode (read and write cycles continuing with same row address)
153 the high-level duty of the cas ? cas wait ad0 ras cas column address 1 data 1 wr ad15 ad0 column address 2 t c 1t c 2 data 2 data 1 data 2 read wr ad15 ad0 write row address 1 figure 8.26 long-pitch, high-speed page mode (read/write cycle)
154 ras down mode and ras up mode: sometimes access to another area can occur between accesses to the dram even though burst operation has been selected. keeping the ras ? ras ras ras ras s refresh control function can be employed to set a cas-before-ras refresh that will keep operation within specifications. see section 8.5.6, refresh control, for details. t p t r t c t c ck a21 a0 ras cas data 1 wr ad15 ad0 t1 dram access dram access external memory space access t c t c data 2 data 3 data 4 column address 1 external memory data column address 2 external memory column address 3 column address 4 row address figure 8.27 ras down mode
155 ? ras a0 ras cas data 1 ad15 ad0 t1 dram access dram access external memory space access t c t r data 2 data 3 t p row address row address external memory data column address 1 column address 2 external memory address column address 3 figure 8.28 ras up mode 8.5.6 refresh control the bsc has a function for controlling dram refreshing. by setting the refresh mode bit (rmode) in the refresh control register (rcr), either cas-before-ras refresh (cbr) or self- refresh can be selected. when no refresh is performed, the refresh timer counter (rtcnt) can be used as an 8-bit interval timer. cas-before-ras refresh (cbr): a refresh is performed at an interval determined by the input clock selected with clock select bits 2 0 (cks2 cks0) in the refresh timer control/status register (rtcsr) and the value set in the refresh time constant register (rtcor). set the values of rtcor and cks2 cks0 so they satisfy the refresh interval specifications of the dram being used. to perform a cbr refresh, clear the rmode bit in rcr to 0 and then set the refresh control bit (rfshe) bit to 1. also write the required values to rtcnt and rtcor. when the clock is subsequently selected with the cks2 cks0 bits in rtcsr, rtcnt will begin to increment from its current value. the rtcnt value is constantly compared with the rtcor value and a cbr refresh is performed when they match. rtcnt is simultaneously cleared to h'00 and incrementing begins again.
156 when the clock is selected with the cks2 cks0 bits, rtcnt immediately begins to increment from its current value. this means that when the rtcor cycle is set after the cks2 cks0 bits are set, the rtcnt count may already be higher than the rtcor cycle. when this occurs, the rtcnt will overflow once (from h'ff to h'00) and incrementing will start again. since the cbr refresh will not be performed until the rtcnt again matches the rtcor value, the initial refresh interval will be rather long. it is thus advisable to set the rtcor cycle prior to setting the cks2 cks0 bits and start it incrementing. when cbr refresh control is being performed after use as an 8-bit interval timer, the rtcnt count value may be in excess of the refresh cycle. for this reason, clear rtcnt by writing h'00 before starting refresh control to assure a correct refresh interval. when the rw1 bit in wcr1 is set to 1 and the read cycle is set to long pitch, the number of wait states selected by the rlw1 and rlw0 bits in rcr will be inserted into the cbr refresh cycle, regardless of the status of the wait cks0 h'00 rtcor value rtcnt value compare match with rtcor compare match with rtcor compare match with rtcor compare match with rtcor cbr: cas-before-ras refresh time figure 8.29 refresh timer counter (rtcnt) operation t rp t rr t rc ck ras cas figure 8.30 output timing for cas-before-ras refresh signal
157 self-refresh mode: some drams have a self-refresh mode (battery back-up mode). this is a type of a standby mode in which the refresh timing and refresh addresses are generated inside the dram chip. when the rfshe and rmode bits in rcr are both set to 1, the dram will enter self-refresh mode when the cas ras s cbr refresh function to set all row addresses for refresh in software. to access a dram area while in self-refresh mode, first clear the rmode bit to 0 and exit self- refresh mode. the chip can be kept in the self-refresh state and shifted to standby mode by setting it to self- refresh mode, setting the standby bit (sby) in the standby control register (sbycr) to 1, and then executing a sleep instruction. t rp t rr ck ras cas figure 8.31 output timing for self-refresh signal refresh requests and bus cycle requests: when a cas-before-ras refresh or self-refresh is requested during bus cycle execution, parallel execution is sometimes possible. table 8.11 summarizes the operation when refresh and bus cycles are in contention.
158 table 8.11 refresh and bus cycle contention type of bus cycle external space access external memory space, multiplexed i/o space dram space on-chip rom, on-chip type of refresh read cycle write cycle read cycle write cycle ram, on-chip supporting module access cas-before- ras refresh yes no no no yes self-refresh yes yes no no yes yes: can be executed in parallel no: cannot be executed in parallel when parallel execution is possible, the ras cas using rtcnt as an 8-bit interval timer: when not performing refresh control, rtcnt can be used as an 8-bit interval timer. simply set the rfshe bit in rcr to 0. to produce a compare match interrupt (cmi), set the compare match interrupt enable bit (cmie) to 1 and set the interrupt generation timing in rtcor. when the input clock is selected with the cks2 cks0 bits in rtcsr, rtcnt starts incrementing as an 8-bit interval timer. its value is constantly compared with rtcor, and when a match occurs, the cmf bit in rtcsr is set to 1 and a cmi interrupt is produced. rtcnt is cleared to h'00. when the clock is selected with the cks2 cks0 bits, rtcnt starts incrementing immediately. this means that when the rtcor cycle is set after the cks2 cks0 bits are set, the rtcnt count may already be higher than the rtcor cycle. when this occurs, the rtcnt will overflow once (h'ff goes to h'00) and the count up will start again. no interrupt will be generated until the rtcnt again matches the rtcor value. it is thus advisable to set the rtcor cycle prior to setting the cks2 cks0 bits. after its use as an 8-bit interval timer, the rtcnt count value may be in excess of the set cycle. for this reason, write h'00 to the rtcnt to clear it before starting to use it again with new settings. rtcnt can then be restarted and an interrupt obtained after the correct interval.
159 8.6 address/data multiplexed i/o space access the bsc is equipped with a function that multiplexes address and data input/output on pins ad15 ad0 in area 6. this allows the sh microprocessor to be directly connected to peripheral chips that require address/data multiplexing. 8.6.1 basic timing when the multiplexed i/o enable bit (ioe) in bcr is set to 1, the area 6 space with address bit a27 as 0 (h'6000000 h'6ffffff) becomes an address/data multiplexed i/o space that, when accessed, multiplexes addresses and data. when the a14 address bit is 0, the bus width is 8 bits and address output and data input/output are performed on the ad7 ad0 pins. when the a14 address bit is 1, the bus width is 16 bits and address output and data input/output are performed on the ad15 ad0 pins. in the address/data multiplexed i/o space, access is controlled with the ah rd wr a0 cs ah ad0 data (input) address data (output) rd ad0 wrh wrl figure 8.32 access timing for address/data multiplexed i/o space
160 a high-level duty of 35% or 50% can be selected for the rd 8.6.2 wait state control when the address/data multiplexed i/o space is accessed, the wait wait a0 cs ah address ad15 ad0 address data (output) rd read ad15 ad0 wrh, wrl write t2 tw (wait state) t3 t4 wait data (input) figure 8.33 wait state timing for address/data multiplexed i/o space access 8.6.3 byte access control the byte access control signals when the address/data multiplexed i/o space is being accessed are of two types ( wrh wrl wr hbs lbs
161 memory space access. these types can be selected using the bas bit in bcr. see section 8.4.3, byte access control, for details. 8.7 parity check and generation the bsc can check and generate parity for data input and output to or from the dram space of area 1 and the external memory space of area 2. to check and generate parity, select the space (dram space only, or dram space and area 2) for which parity is to be checked and generated using the parity check enable bits (pchk1 and pchk0) in the parity control register, and select odd or even parity with the parity polarity bit (peo). when data is input from the space selected with the pchk1 and pchk0 bits, the bsc checks the peo bit to see if the polarity of the dph pin input (upper byte parity data) is accurate for the ad15 ad8 pin input (upper byte data) or if the dpl pin input (lower byte parity data) is accurate for the ad7 ad0 pin input (lower byte data). if the check indicates that either the upper or lower byte parity is incorrect, a parity error interrupt is produced (pei). when outputting data to the space selected with the pchk1 and pchk0 bits, the bsc outputs parity data output of the polarity set in the peo bit from the dph pin for the ad15 ad8 pin output (upper byte data) or from the dpl pin for the ad7 ad0 pin input (lower byte data) using the same timing as the data output. the bsc is also able to force parity output for use in testing the system's parity error check function. when the parity force output bit (pfrc) in pcr is set to 1, a high level is forcibly output from the dph and dpl pins when data is output to the space selected with the pchk1 and pchk0 bits.
162 8.8 warp mode in warp mode, an external write cycle or dma single address mode transfer cycle and an internal access cycle (read/write to on-chip memory or on-chip supporting modules) operate independently and in parallel. warp mode is entered by setting the warp mode bit (warp) in bcr to 1. this allows the chip to be operated at high speed. when, in warp mode, an external write cycle or dma single address mode transfer cycle continues for at least 2 states and there is an internal access, only the external write cycle will be performed in the initial state. the external write cycle and internal access cycle will be performed in parallel from the next state on, without waiting for the end of the external write cycle. figure 8.34 shows the timing when an access to an on-chip supporting module and an external write cycle are performed in parallel.
163 t1 ck a21 a0 csn wr ad0 external space write internal address internal write strobe internal data bus internal read strobe internal data bus on-chip supporting module write on-chip supporting module read external space address write data external space address write data read data on-chip supporting module address figure 8.34 warp mode timing (access to on-chip supporting module and external write cycle) 8.9 wait state control the wcr1 wcr3 registers of the bsc can be set to control sampling of the wait
164 table 8.12 bus cycle states when accessing address spaces cpu read cycle, dmac dual mode read cycle, dmac single mode memory read/write cycle address space corresponding bits in wcr1 and wcr2 = 0 corresponding bits in wcr1 and wcr2 = 1 external memory (areas 1, 3 5, 7) 1 state fixed; wait wait wait wait wait wait wait wait wait wait wait 5, 7) 2 states + wait states from wait wait wait wait wait wait wait wait
165 accesses to on-chip spaces are as follows: on-chip supporting module spaces (area 5 when address bit a27 is 1) are always 3-state access spaces, regardless of wcr, with no wait md0 are 010) and on-chip ram (area 7 when address bit a27 is 0) are always performed in 1 state, regardless of wcr, with no wait wait wait wait
166 8.10 bus arbitration the superh microcomputer can release the bus to external devices when they request the bus. it has two internal bus masters, the cpu and the dmac. priorities for releasing the bus for these two are as follows. bus request from external device > refresh > dmac > cpu thus, an external device has priority when it generates a bus request, even when the dmac is carrying out a burst transfer. note that when a refresh request is generated while the bus is released to an external device, back breq breq back figure 8.35 bus release procedure
167 8.10.1 operation of bus arbitration if there is conflict between bus arbitration and refreshing, the operation is as follows. 1. if dram refreshing is requested in this chip when the bus is released and back back breq back breq back back breq breq breq back breq breq back back back back breq figure 8.36 back operation in response to refresh demand (1)
168 back breq if back has not gone low after waiting for the maximum number of states * before the superh releases the bus, return breq to the high level. note: * for details see section 8.11.3, maximum number of states from breq input to bus release. back does not go low. refresh request figure 8.37 back operation in response to refresh request (2) 3. if a refresh request is generated during dma transfer in burst mode, the dma transfer is halted and a refresh is executed. 8.10.2 back operation 1. back back back breq back back breq back
169 note that delay of the back back back back back back back 8.11 usage notes 8.11.1 usage notes on manual reset condition: when dram (long-pitch mode) is used and a manual reset is performed. the low width of ras
170 corresponding dram conditions: long-pitch/normal mode long-pitch/high-speed page mode there are no problems regarding operations except for the above conditions. there are the following four cases (figures 8.38 to 8.41) for the output states of dram control signals ( ras cas wr res res a21 ras cas wr ad15 row address res latch timing tp tr tc1 tc2 data output manual reset column address ffff figure 8.38 long-pitch mode write (1) row address res latch timing tp tr tc1 tc2 data output manual reset ck res a21 ras cas wr ad15 ffff figure 8.39 long-pitch mode write (2)
171 rd res a21 ras cas figure 8.40 long-pitch mode read (1) tp tr tc1 tc2 manual reset rd res a21 ras cas figure 8.41 long-pitch mode read (2) for the signal output shown by solid lines, dram data may not be held. therefore, when dram data must be held after a reset, take one of the measures described below. 1. when resetting manually, use the watchdog timer (wdt) reset function. 2. even if the low width of ras ras ras ras
172 8.11.2 usage notes on parity data pins dph and dpl the following specifies the setup time, t ds , of parity data dph and dpl with respect to the fall of the cas table 8.13 setup time of parity data dph and dpl item symbol min data setup time with respect to cas wrh wrl ras cas rd we q ras cas wrh wrl dwrh dwrl oe figure 8.42 delayed-write control circuit 8.11.3 maximum number of states from breq input to bus release the maximum number of states from breq breq breq
173 the maximum number of states from breq figure 8.43 when breq is input without satisfying tbrqs 1. cycles in which bus is not released (a) one bus cycle the bus is never released during one bus cycle. for example, in the case of a longword read (or write) in 8-bit ordinary space, one bus cycle consists of 4 memory accesses to 8-bit ordinary space, as shown in figure 8.44. the bus is not released between these accesses. assuming one memory access to require 2 states, the bus is not released for a period of 8 states. 8 bits 8 bits cycle during which bus is not released 8 bits 8 bits figure 8.44 one bus cycle (b) tas instruction read cycle and write cycle the bus is never released during a tas instruction read cycle and write cycle (figure 8.45). the tas instruction read cycle and write cycle should be regarded as one bus cycle during which the bus is not released. read cycle cycle during which bus is not released (1 bus cycle) write cycle figure 8.45 tas instruction read cycle and write cycle
174 (c) refresh cycle + bus cycle the bus is never released during a refresh cycle and the following bus cycle ((a) or (b) above)) (figure 8.46). refresh cycle cycle during which bus is not released 1 bus cycle figure 8.46 refresh cycle and following bus cycle 2. bus release procedure the bus release procedure is shown in figure 8.47. figure 8.47 shows the case where breq breq breq figure 8.47 bus release procedure
175 section 9 direct memory access controller (dmac) 9.1 overview the superh microcomputer chip includes a four-channel direct memory access controller (dmac). the dmac can be used in place of the cpu to perform high speed transfers between external devices that have dack (transfer request acknowledge signal), external memory, memory-mapped external devices, on-chip memory, and on-chip supporting modules (excluding the dmac itself). using the dmac reduces the burden on the cpu and increases overall operating efficiency. 9.1.1 features the dmac has the following features. ? four channels ? four gbytes of address space in the architecture ? byte or word selectable as data transfer unit ? 65536 transfers (maximum) ? single address mode transfers (channels 0 and 1): either the transfer source or transfer destination (peripheral device) is accessed by a dack signal (selectable) while the other is accessed by address. one transfer unit of data is transferred in each bus cycle. device combinations for which transfer is possible: ? external device with dack and memory-mapped external device (including external memories) ? external device with dack and memory-mapped external memory ? dual address mode transfer (channels 0?): both the transfer source and transfer destination are accessed by address. one transfer unit of data is transferred in 2 bus cycles. device combinations for which transfer is possible: ? two external memories ? external memory and memory-mapped external device ? two memory-mapped devices ? external memory and on-chip memory ? memory-mapped external device and on-chip supporting module (excluding the dmac) ? external memory and on-chip memory ? memory-mapped external device and on-chip supporting module (excluding the dmac) ? two on-chip memories ? on-chip memory and on-chip supporting module (excluding the dmac) ? two on-chip supporting modules (excluding the dmac)
176 ? transfer requests ? external request (from dreq pins (channels 0 and 1 only). dreq can be detected either by edge or by level) ? requests from on-chip supporting modules (serial communication interface (sci), a/d converter (a/d), and 16-bit integrated timer pulse unit (itu)) ? auto-request (the transfer request is generated automatically within the dmac) ? selectable bus modes: cycle-steal mode or burst mode ? selectable channel priority levels: fixed, round-robin, or external-pin round-robin modes ? cpu can be asked for interrupt when data transfer ends ? maximum transfer rate ? 20 m words/s (320 mb/s) for 5 v and 20 mhz bus mode: burst mode transmission size: word 9.1.2 block diagram figure 9.1 shows a block diagram of the dmac.
177 dreq0 , dreq1 itu sci a/d converter dack0, dack1 dein dmac on-chip rom on-chip ram on-chip supporting module peripheral bus external bus external rom external ram external device (memory- mapped) external device (with acknowledge) bus controller iteration control register control start-up control request priority control bus interface dmac module bus sarn darn tcrn chcrn dmaor internal bus dmaor: dma operation register sarn: dma source address register darn: dma destination address register tcrn: dma transfer count register chcrn: dma channel control register dein: dma transfer-end interrupt request to cpu n: 0? figure 9.1 block diagram of dmac
178 9.1.3 pin configuration table 9.1 shows the dmac pins. table 9.1 pin configuration channel name symbol i/o function 0 dma transfer request dreq0 i dma transfer request input from external device to channel 0 dma transfer request acknowledge dack0 o dma transfer request acknowledge output from channel 0 to external device 1 dma transfer request dreq1 i dma transfer request input from external device to channel 1 dma transfer request acknowledge dack1 o dma transfer request acknowledge output from channel 1 to external device
179 9.1.4 register configuration table 9.2 summarizes the dmac registers. the dmac has a total of 17 registers. each channel has four control registers. one other control register is shared by all channels. table 9.2 dmac registers chan- nel name abbrevi- ation r/w initial value address * 4 access size 0 dma source address register 0 sar0 * 3 r/w undefined h'5ffff40 16, 32 dma destination address register 0 dar0 * 3 r/w undefined h'5ffff44 16, 32 dma transfer count register 0 tcr0 * 3 r/w undefined h'5ffff4a 16, 32 dma channel control register 0 chcr0 r/(w) * 1 h'0000 h'5ffff4e 8, 16, 32 1 dma source address register 1 sar1 * 3 r/w undefined h'5ffff50 16, 32 dma destination address register 1 dar1 * 3 r/w undefined h'5ffff54 16, 32 dma transfer count register 1 tcr1 * 3 r/w undefined h'5ffff5a 16, 32 dma channel control register 1 chcr1 r/(w) * 1 h'0000 h'5ffff5e 8, 16, 32 2 dma source address register 2 sar2 * 3 r/w undefined h'5ffff60 16, 32 dma destination address register 2 dar2 * 3 r/w undefined h'5ffff64 16, 32 dma transfer count register 2 tcr2 * 3 r/w undefined h'5ffff6a 16, 32 dma channel control register 2 chcr2 r/(w) * 1 h'0000 h'5ffff6e 8, 16, 32 3 dma source address register 3 sar3 * 3 r/w undefined h'5ffff70 16, 32 dma destination address register 3 dar3 * 3 r/w undefined h'5ffff74 16, 32 dma transfer count register 3 tcr3 * 3 r/w undefined h'5ffff7a 16, 32 dma channel control register 3 chcr3 r/(w) * 1 h'0000 h'5ffff7e 8, 16, 32 shar- ed dma operation register dmaor r/(w) * 2 h'0000 h'5ffff48 8, 16, 32 notes: * 1 only 0 can be written in bit 1 of chcr0?hcr3, to clear flags. * 2 only 0 can be written in bits 1 and 2 of dmaor, to clear flags. * 3 access sar0?ar3, dar0?ar3, and tcr0?cr3 by longword or word. if byte access is used when writing, the value of the register contents will be undefined; if used when reading, the value read will be undefined. * 4 only the values of bits a27?24 and a8?0 are valid; bits a23?9 are ignored. for details on the register addresses, see section 8.3.5, area descriptions.
180 9.2 register descriptions 9.2.1 dma source address registers 0? (sar0?ar3) dma source address registers 0? (sar0?ar3) are 32-bit read/write registers that specify the source address of a dma transfer. during a dma transfer, these registers indicate the next source address (in single-address mode, sar is ignored in transfers from external devices with dack to memory-mapped external devices or external memory). the initial value after a reset or in standby mode is undefined. bit: 31 30 29 28 27 26 25 24 bit name: initial value: r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 23 22 21 0 bit name: initial value: r/w: r/w r/w r/w r/w 9.2.2 dma destination address registers 0? (dar0?ar3) dma destination address registers 0? (dar0?ar3) are 32-bit read/write registers that specify the destination address of a dma transfer. during a dma transfer, these registers indicate the next destination address (in single-address mode, dar is ignored in transfers from memory- mapped external devices or external memory to external devices with dack). the initial value after a reset or in standby mode is undefined. bit: 31 30 29 28 27 26 25 24 bit name: initial value: r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 23 22 21 0 bit name: initial value: r/w: r/w r/w r/w r/w
181 9.2.3 dma transfer count registers 0? (tcr0?cr3) dma transfer count registers 0? (tcr0?cr3) are 16-bit read/write registers that specify the dma transfer count (bytes or words). the number of transfers is 1 when the setting is h'0001, 65535 when the setting is h'ffff, and 65536 (the maximum) when h'0000 is set. during a dma transfer, these registers indicate the remaining transfer count. the initial value after a reset or in standby mode is undefined. bit: 15 14 13 12 11 10 9 8 bit name: initial value: r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: initial value: r/w: r/w r/w r/w r/w r/w r/w r/w r/w 9.2.4 dma channel control registers 0? (chcr0?hcr3) dma channel control registers 0? (chcr0?hcr3) are 16-bit read/write registers that control the dma transfer mode. they also indicate the dma transfer status. they are initialized to h'0000 by a reset and in standby mode. bit: 15 14 13 12 11 10 9 8 bit name: dm1 dm0 sm1 sm0 rs3 rs2 rs1 rs0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: am al ds tm ts ie te de initial value: 0 0 0 0 0 0 0 0 r/w: r/(w) * 2 r/(w) * 2 r/(w) * 2 r/w r/w r/w r/(w) * 1 r/w notes: * 1 only 0 can be written, to clear the flag. * 2 writing is valid only for chcr0 and chcr1.
182 ? bits 15 and 14 (destination address mode bits 1 and 0 (dm1 and dm0)): dm1 and dm0 select whether the dma destination address is incremented, decremented, or left fixed (in the single address mode, dm1 and dm0 are ignored when transfers are made from memory- mapped external devices or external memory to external devices with dack). dm1 and dm0 are initialized to 00 by a reset and in standby mode. bit 15: dm1 bit 14: dm0 description 0 0 fixed destination address (initial value) 0 1 destination address is incremented (+1 or +2 depending on whether the transfer size is word or byte) 1 0 destination address is decremented (? or ? depending on whether the transfer size is word or byte) 1 1 reserved (illegal setting) ? bits 13 and 12 (source address mode bits 1, 0 (sm1 and sm0)): sm1 and sm0 select whether the dma source address is incremented, decremented, or left fixed (in the single address mode, sm1 and sm0 are ignored when transfers are made from external devices with dack to memory-mapped external devices or external memory). sm1 and sm0 are initialized to 00 by resets or in standby mode. bit 13: sm1 bit 12: sm0 description 0 0 fixed source address (initial value) 0 1 source address is incremented (+1 or +2 depending on if the transfer size is word or byte) 1 0 source address is decremented (? or ? depending on if the transfer size is word or byte) 1 1 reserved (illegal setting) ? bits 11? (resource select bits 3? (rs3?s0)): rs3?s0 specify which transfer requests will be sent to the dmac. do not change the transfer request source unless the dma enable bit (de) is 0. the rs3?s0 bits are initialized to 0000 by a reset and in standby mode.
183 bit 11: rs3 bit 10: rs2 bit 9: rs1 bit 8: rs0 description 0000 dreq (external request * 1 , dual address mode) (initial value) 0001 reserved (illegal setting) 0010 dreq (external request * 1 , single address mode * 2 ) 0011 dreq (external request * 1 , single address mode * 3 ) 0100 rxi0 (on-chip serial communication interface 0 receive data full interrupt transfer request) * 4 0101 txi0 (on-chip serial communication interface 0 transmit data empty interrupt transfer request) * 4 0110 rxi1 (on-chip serial communication interface 1 receive data full interrupt transfer request) * 4 0111 txi1 (on-chip serial communication interface 1 transmit data empty interrupt transfer request) * 4 1000 imia0 (on-chip itu0 input capture/compare match a interrupt transfer request) * 4 1001 imia1 (on-chip itu1 input capture/compare match a interrupt transfer request) * 4 1010 imia2 (on-chip itu2 input capture/compare match a interrupt transfer request) * 4 1011 imia3 (on-chip itu3 input capture/compare match a interrupt transfer request) * 4 1100 auto-request (transfer requests automatically generated within dmac) * 4 1101 adi (a/d conversion end interrupt request of on-chip a/d converter) * 4 1110 reserved (illegal setting) 1111 reserved (illegal setting) sci0, sci1: serial communication interface channels 0 and 1 itu0?tu3: channels 0? of the 16-bit integrated timer pulse unit notes: * 1 these bits are valid only in channels 0 and 1. none of these request sources can be selected in channels 2 and 3. * 2 transfer from memory-mapped external device or external memory to external device with dack. * 3 transfer from external device with dack to memory-mapped external device or external memory. * 4 dual address mode.
184 ? bit 7 (acknowledge mode bit (am)): in dual address mode, am selects whether the dack signal is output during the data read cycle or write cycle. this bit is valid only in channels 0 and 1. the am bit is initialized to 0 by a reset and in standby mode. the am bit is not valid in single address mode. bit 7: am description 0 dack is output in read cycle (initial value) 1 dack is output in write cycle ? bit 6 (acknowledge level bit (al)): al selects active-high or active-low for the dack signal. this bit is valid only in channels 0 and 1. the al bit is initialized to 0 by a reset and in standby mode. bit 6: al description 0 dack is active-high (initial value) 1 dack is active-low ? bit 5 ( dreq select bit (ds)): ds selects the dreq input detection method used. this bit is valid only in channels 0 and 1. the ds bit is initialized to 0 by a reset and in standby mode. bit 5: ds description 0 dreq detected by low level (initial value) 1 dreq detected by falling edge ? bit 4 (transfer bus mode bit (tm)): tm selects the bus mode for dma transfers. the tm bit is initialized to 0 by a reset and in standby mode. when the source of the transfer request is an on-chip supporting module, see table 9.4, selecting on-chip peripheral module request modes with the rs bits. bit 4: tm description 0 cycle-steal mode (initial value) 1 burst mode ? bit 3 (transfer size bit (ts)): ts selects the transfer unit size. if the on-chip supporting module that is the source or destination of the transfer can only be accessed in bytes, byte must be selected with this bit. the ts bit is initialized to 0 by a resets and in standby mode.
185 bit 3: ts description 0 byte (8 bits) (initial value) 1 word (16 bits) ? bit 2 (interrupt enable bit (ie)): ie determines whether or not to request a cpu interrupt at the end of a dma transfer. when the ie bit is set to 1, an interrupt (dei) request is sent to the cpu when the te bit is set. the ie bit is initialized to 0 by a reset and in standby mode. bit 2: ie description 0 interrupt request disabled (initial value) 1 interrupt request enabled ? bit 1 (transfer end flag bit (te)): te indicates that the transfer has ended. when a dma transfer ends normally and the value in the dma transfer count register (tcr) becomes 0, the te bit is set to 1. this flag is not set if the transfer ends because of an nmi interrupt or address error, or because the de bit or the dme bit in the dma operation register (dmaor) was cleared. to clear the te bit, read 1 from it and then write 0. when this flag is set, setting the de bit to 1 does not enable a dma transfer. the te bit is initialized to 0 by a reset and in standby mode. bit 1: te description 0 dma has not ended or was aborted (initial value) to clear te, the cpu must read te after it has been set to 1, then write a 0 in this bit 1 dma has ended normally ? bit 0 (dma enable bit (de)): de enables or disables dma transfers. in auto-request mode, the transfer starts when this bit or the dme bit in dmaor is set to 1. the te bit and the nmif and ae bits in dmaor must be all cleared to 0. in external request mode or on-chip supporting module request mode, the transfer begins when the dma transfer request is received from a device or on-chip supporting module, provided this bit and the dme bit are set to 1. as with auto request mode, the te bit and the nmif and ae bits must be all cleared to 0. the transfer can be stopped by clearing this bit to 0. the de bit is initialized to 0 by a reset and in standby mode.
186 bit 0: de description 0 dma transfer disabled (initial value) 1 dma transfer enabled 9.2.5 dma operation register (dmaor) the dma operation register (dmaor) is a 16-bit read/write register that controls the dma transfer mode. it also indicates the dma transfer status. it is initialized to h'0000 by a reset and in standby mode. bit: 15 14 13 12 11 10 9 8 bit name: pr1 pr0 initial value: 0 0 0 0 0 0 0 0 r/w: r r r r r r r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: ae nmif dme initial value: 0 0 0 0 0 0 0 0 r/w: r r r r r r/(w) * r/(w) * r/w note: * write only 0 to clear the flag. ? bits 15?0 (reserved): these bits are always read as 0. the write value should always be 0. ? bits 9 and 8 (priority mode bits 1 and 0 (pr1 and pr0)): pr1 and pr0 select the priority level between channels when there are simultaneous transfer requests for multiple channels. bit 9: pr1 bit 8: pr0 description 0 0 fixed priority order (ch. 0 > ch. 3 > ch. 2 > ch. 1) (initial value) 0 1 fixed priority order (ch. 1 > ch. 3 > ch. 2 > ch. 0) 1 0 round-robin mode priority order (the priority order immediately after a reset is ch. 0 > ch. 3 > ch. 2 > ch. 1) 1 1 external-pin round-robin mode priority order (the priority order immediately after a reset is ch. 3 > ch. 2 > ch. 1 > ch. 0) ? bits 7? (reserved): these bits are always read as 0. the write value should always be 0.
187 ? bit 2 (address error flag bit (ae)): ae indicates that an address error has occurred in the dmac. when this flag is set to 1, the channel cannot be enabled even if the de bit in the dma channel control register (chcr) and the dme bit are set to 1. to clear the ae bit, read 1 from it and then write 0. it is initialized to 0 by a reset and in standby mode. bit 2: ae description 0 no dmac address error (initial value) to clear the ae bit, read 1 from it and then write 0 1 address error by dmac ? bit 1 (nmi flag bit (nmif)): nmif indicates that an nmi interrupt has occurred. when this flag is set to 1, the channel cannot be enabled even if the de bit in chcr and the dme bit are set to 1. to clear the nmif bit, read 1 from it and then write 0. it is initialized to 0 by a reset and in standby mode. bit 1: nmif description 0 no nmi interrupt (initial value) to clear the nmif bit, read 1 from it and then write 0 1 nmi has occurred ? bit 0 (dma master enable bit (dme)): dme enables or disables dma transfers on all channels. a channel becomes enabled for a dma transfer when the de bit in each dma's chcr and the dme bit are set to 1. for this to be effective, however, the te bit of each chcr and the nmif and ae bits must all be 0. when the dme bit is cleared, all channel dma transfers are aborted. bit 0: dme description 0 dma transfers disabled on all channels (initial value) 1 dma transfers enabled on all channels
188 9.3 operation when there is a dma transfer request, the dmac starts the transfer according to the predetermined channel priority order; when the transfer end conditions are satisfied, it ends the transfer. transfers can be requested in three modes: auto-request, external request, and on-chip module request. transfer can be in either single address mode or dual address mode. the bus mode can be either burst or cycle steal. 9.3.1 dma transfer flow after the dma source address registers (sar), dma destination address registers (dar), dma transfer count registers (tcr), dma channel control registers (chcr), and dma operation register (dmaor) are set, the dmac transfers data according to the following procedure: 1. checks to see if transfer is enabled (de = 1, dme = 1, te = 0, nmif = 0, ae = 0). 2. when a transfer request arrives and transfer is enabled, the dmac transfers one transfer unit of data. (for an auto-request, the transfer begins automatically when the de bit and dme bit are set to 1. the tcr value will be decremented by 1.) the actual transfer flows vary by address mode and bus mode. 3. when the specified number of transfer have been completed (when tcr reaches 0), the transfer ends normally. if the ie bit in chcr is set to 1 at this time, a dei interrupt is sent to the cpu. 4. when an address error occurs in the dmac or an nmi interrupt is generated, the transfer is aborted. transfers are also aborted when the de bit in chcr or the dme bit in dmaor changes to 0. figure 9.2 shows a flowchart of this procedure.
189 transfer ends normal end does nmif = 1, ae = 1, de = 0, and dme = 0? tcr = 0? de, dme = 1 and nmif, ae, te = 0? does nmif = 1, ae = 1, de = 0, or dme = 0? bus mode, transfer request mode, dreq 1 dreq dreq figure 9.2 dma transfer flowchart
190 9.3.2 dma transfer requests dma transfer requests are basically generated in either the data transfer source or destination, but they can also be generated by devices and on-chip supporting modules that are neither the source nor the destination. transfers can be requested in three modes: auto-request, external request, and on-chip module request. the request mode is selected with the rs3 rs0 bits in the dma channel control registers 0 3 (chcr0 chcr3). auto-request mode: when there is no transfer request signal from an external source, as in a memory-to-memory transfer or a transfer between memory and an on-chip supporting module unable to request a transfer, the auto-request mode allows the dmac to automatically generate a transfer request signal internally. when the de bits in chcr0 chcr3 and the dme bit in dmaor are set to 1, the transfer begins (so long as the te bits in chcr0 chcr3 and the nmif and ae bits in dmaor are all 0). external request mode: in this mode a transfer is performed in response to a request signal ( dreq dreq dreq chcr3 (ds = 0 specifies level detection, ds = 1 specifies edge detection). the source of the transfer request does not have to be the data transfer source or destination. table 9.3 selecting external request modes with the rs bits rs3 rs2 rs1 rs0 address mode source destination 0000 dual address mode any * any * 0010 single address mode external memory or memory-mapped external device external device with dack 0011 single address mode external device with dack external memory or memory-mapped external device note: * external memory, memory-mapped external device, on-chip memory, on-chip supporting module (excluding dmac) on-chip module request: in this mode a transfer is performed in response to a transfer request signal (interrupt request signal) of an on-chip module. the transfer request signals include the receive data full interrupt (rxi) of the serial communication interface (sci), the transmit data empty interrupt (txi) of the sci, the input capture a/compare match a interrupt request (imia) of the 16-bit integrated pulse timer (itu), and the a/d conversion end interrupt (adi) of the a/d converter (table 9.4). when this mode is selected, if dma transfer is enabled (de = 1, dme = 1, te = 0, nmif = 0, ae = 0), a transfer is performed upon input of a transfer request signal. the
191 source of the transfer request does not have to be the data transfer source or destination. when rxi is set as the transfer request, however, the transfer source must be the sci s receive data register (rdr). likewise, when txi is set as the transfer request, the transfer source must be the sci s transmit data register (tdr). if the transfer request is from the a/d converter, the data transfer source must be an a/d converter register. table 9.4 selecting on-chip peripheral module request modes with the rs bits rs 3 rs 2 rs 1 rs 0 dma transfer request source dma transfer request signal source desti- nation bus mode 0 1 0 0 sci0 receiver rxi0 (sci0 receive data full interrupt transfer request) rdr0 any * cycle steal 0 1 0 1 sci0 transmitter txi0 (sci0 transmit data empty interrupt transfer request) any tdr0 cycle steal 0 1 1 0 sci1 receiver rxi1 (sci1 receive data full interrupt transfer request) rdr1 any * cycle steal 0 1 1 1 sci1 transmitter txi1 (sci1 transmit data empty interrupt transfer request) any * tdr1 cycle steal 1 0 0 0 itu0 imia0 (itu0 input capture a/ compare match a) any * any * burst/cycle steal 1 0 0 1 itu1 imia1 (itu1 input capture a/ compare match a) any * any * burst/cycle steal 1 0 1 0 itu2 imia2 (itu2 input capture a/ compare match a) any * any * burst/cycle steal 1 0 1 1 itu3 imia3 (itu3 input capture a/ compare match a) any * any * burst/cycle steal 1101a/d converter adi (a/d conversion end interrupt) addr any burst/cycle steal sci0, sci1: serial communication interface channels 0 and 1 itu0-itu3: channels 0 3 of the 16-bit integrated timer pulse unit rdr0, rdr1: receive data registers 0, 1 of sci tdr0, tdr1: transmit data registers 0, 1 of sci addr: a/d data register of a/d converter note: * external memory, memory-mapped external device, on-chip memory, on-chip supporting module (excluding dmac)
192 when outputting transfer requests from on-chip supporting modules, the appropriate interrupt enable bits must be set to output the interrupt signals. note that transfer request signals from on- chip supporting modules (interrupt request signals) are sent not just to the dmac but to the cpu as well. when an on-chip supporting module is specified as the transfer request source, set the priority level values in the interrupt priority level registers (iprc ipre) of the interrupt controller (intc) at or below the levels set in the i3 i0 bits of the cpu's status register (sr) so that the cpu does not acknowledge the interrupt request signal. the dma transfer request signals in table 9.4 are automatically withdrawn when the corresponding dma transfer is performed. if cycle steal mode is being used, the dma transfer request (interrupt request) will be cleared at the first transfer; if burst mode is being used, it will be cleared at the last transfer. 9.3.3 channel priority when the dmac receives simultaneous transfer requests on two or more channels, it selects a channel according to a predetermined priority order. the three modes (fixed mode, round-robin mode, and external-pin round-robin mode) are selected by priority bits pr1 and pr0 in the dma operation register. fixed mode: in this mode, the priority levels among the channels remain fixed. when the pr1 and pr0 bits are set to 00, the priority order, high to low, is ch. 0 > ch. 3 > ch. 2 > ch. 1. when the pr1 and pr0 bits are set to 01, the priority order, high to low, is ch. 1 > ch. 3 > ch. 2 > ch. 0. round-robin mode: each time one word or byte is transferred on one channel, the priority order is rotated. the channel on which the transfer just finished rotates to the bottom of the priority order. when necessary, the priority order of channels other than the one that just finished the transfer can also be shifted to keep the relationship between the channels from changing (figure 9.3). the priority order immediately after a reset is channel 0 > channel 3 > channel 2 > channel 1.
193 ch0 > > > > > > > > > > > > > > > > > > > > > > > > > > > figure 9.3 round-robin mode figure 9.4 shows how the priority order changes when channel 0 and channel 1 transfers are requested simultaneously and a channel 3 transfer is requested during the channel 0 transfer. the dmac operates as follows:
194 1. transfer requests are generated simultaneously for channels 1 and 0. 2. channel 0 has a higher priority, so the channel 0 transfer begins first (channel 1 waits for transfer). 3. a channel 3 transfer request occurs during the channel 0 transfer (channels 1 and 3 are both waiting) 4. when the channel 0 transfer ends, channel 0 becomes the lowest priority. 5. at this point, channel 3 has a higher priority than channel 1, so the channel 3 transfer begins (channel 1 waits for transfer). 6. when the channel 3 transfer ends, channel 3 becomes the lowest priority. 7. the channel 1 transfer begins. 8. when the channel 1 transfer ends, channels 1 and 2 shift downward in priority so that channel 1 becomes the lowest priority. 1 1, 3 1 none (1) channels 0 and 1 (3) channel 3 (2) channel 0 transfer starts priority order changes 0 > > > > > > > > > > > > figure 9.4 changes in channel priority in round-robin mode
195 external-pin round-robin mode: external-pin round-robin mode switches the priority levels of channel 0 and channel 1, which are the channels that can receive transfer requests from external pins dreq0 dreq1
196 0 none none (1) channels 0 and 1 (6) channel 0 (2) channel 1 transfer starts (3) channel 1 transfer ends (5) channel 0 transfer ends (7) channel 0 transfer starts (4) channel 0 transfer starts (8) channel 0 transfer ends priority order changes 3 > > > > > > > > > > > > figure 9.5 example of changes in priority in external-pin round-robin mode
197 9.3.4 dma transfer types the dmac supports the transfers shown in table 9.5. it can operate in single address mode or dual address mode, which are defined by how many bus cycles the dmac takes to access the transfer source and transfer destination. the actual transfer operation timing varies with the bus mode. the dmac has two bus modes: cycle-steal mode and burst mode. table 9.5 supported dma transfers destination source external device with dack external memory memory- mapped external device on-chip memory on-chip supporting module external device with dack not available single single not available not available external memory single dual dual dual dual memory-mapped external device single dual dual dual dual on-chip memory not available dual dual dual dual on-chip supporting module not available dual dual dual dual single: single address mode dual: dual address mode address modes: ?
198 dmac dack dreq external memory external device with dack superh microcomputer external address bus : data flow external data bus read write 1 2 note: the read/write direction is decided by the rs3-rs0 bits in the chcrn registers. if rs3 rs0 = 0010, the direction is as shown in case 1 (circled number above); if rs3 rs0 = 0011, the direction is as shown in case 2. in the electrical characteristics section, dack output (read) indicates case 1, and dack output (write) indicates case 2. figure 9.6 data flow in single address mode two types of transfers are possible in single address mode: 1) transfers between external devices with dack and memory-mapped external devices, and 2) transfers between external devices with dack and external memory. the only transfer request for either of these is the external request ( dreq
199 ck a21 a0 cs d0 dack wrh wrl wr (a) external device with dack to external memory space ck a21 a0 cs d0 rd rd (b) external memory space to external device with dack figure 9.7 examples of dma transfer timing in single address mode ?
200 dmac external memory external memory superh microcomputer 2 1 external data bus : data flow 1: read cycle 2: write cycle figure 9.8 data flow in dual address mode in dual address mode transfers, external memory, memory-mapped external devices, on-chip memory and on-chip supporting modules can be mixed without restriction. specifically, this enables the following transfer types: 1. between external memory and a external memory 2. between external memory and a memory-mapped external device 3. between a memory-mapped external devices 4. between external memory and on-chip memory 5. between external memory and an on-chip supporting module (excluding the dmac) 6. between memory-mapped external device and on-chip memory 7. between memory-mapped external device and an on-chip supporting module (excluding the dmac) 8. on-chip memory to on-chip memory 9. between on-chip memory and an on-chip supporting module (excluding the dmac) 10. between on-chip supporting modules (excluding the dmac) transfer requests can be auto requests, external requests, or on-chip supporting module requests. when the transfer request source is either the sci or a/d converter, however, either the data destination or source must be the sci or a/d converter (table 9.4). in dual address mode, dack is output in read or write cycles other than for internal memory and external supporting modules. chcr controls the cycle in which dack is output. figure 9.9 shows the dma transfer timing in dual address mode.
201 ck a21 a0 cs d0 dack wrh wrl rd figure 9.9 dma transfer timing in dual address mode (external memory space to external memory space transfer with dack output in read cycle) bus modes: there are two bus modes: cycle-steal and burst. select the mode with the tm bits in chcr0 chcr3. ? ? ? dreq dreq figure 9.10 transfer example in cycle-steal mode (dual address mode, dreq level detection)
202 ? dreq dreq ? ? dreq dreq figure 9.11 transfer example in burst mode (single address mode, dreq level detection) relationship between request modes and bus modes by dma transfer category: table 9.6 shows the relationship between request modes and bus modes by dma transfer category.
203 table 9.6 relationship of request modes and bus modes by dma transfer category address mode transfer category request mode bus mode transfer size (bits) usable channels single external device with dack and external memory external b/c 8/16 0,1 external device with dack and memory-mapped external device external b/c 8/16 0, 1 dual external memory and external memory all * 1 b/c 8/16 0 3 * 5 external memory and memory- mapped external device all * 1 b/c 8/16 0 3 * 5 memory-mapped external device and memory-mapped external device all * 1 b/c 8/16 0 3 * 5 external memory and on-chip memory all * 1 b/c 8/16 0 3 * 5 external memory and on-chip supporting module all * 2 b/c * 3 8/16 * 4 0 3 * 5 memory-mapped external device and on-chip memory all * 1 b/c 8/16 0 3 * 5 memory-mapped external device and on-chip supporting module all * 2 b/c * 3 8/16 * 4 0 3 * 5 on-chip memory and on-chip memory all * 1 b/c 8/16 0 3 * 5 on-chip memory and on-chip supporting module all * 2 b/c * 3 8/16 * 4 0 3 * 5 on-chip supporting module and on- chip supporting module all * 2 b/c * 3 8/16 * 4 0 3 * 5 b: burst, c: cycle steal notes: * 1 external requests, auto requests and on-chip supporting module requests are all available. for on-chip supporting module requests, however, sci and a/d converter cannot be specified as the transfer request source. * 2 external requests, auto requests and on-chip supporting module requests are all available. when the sci or a/d converter is also the transfer request source, however, the transfer destination or transfer source must be the sci or a/d converter, respectively. * 3 if the transfer request source is the sci, cycle-steal only. * 4 the access size permitted when the transfer destination or source is an on-chip supporting module register. * 5 if the transfer request is an external request, channels 0 and 1 only.
204 bus mode and channel priority order: when a given channel (1) is transferring in burst mode and there is a transfer request to a channel (2) with a higher priority, the transfer of the channel with higher priority (2) will begin immediately. when channel 2 is also operating in burst mode, the channel 1 transfer will continue when the channel 2 transfer has completely finished. when channel 2 is in cycle-steal mode, channel 1 will begin operating again after channel 2 completes the transfer of one transfer unit, but the bus will then switch between the two in the order channel 1, channel 2, channel 1, channel 2. since channel 1 is in burst mode, it will not give the bus to the cpu. this example is illustrated in figure 9.12. cpu bus status dmac ch1 dmac ch1 dmac ch2 dmac ch1 dmac ch2 dmac ch1 dmac ch1 cpu ch2 ch1 ch2 dmac ch1 and ch2 cycle-steal mode dmac ch1 burst mode cpu cpu dmac ch1 burst mode priority order is ch0 > ch3 > ch2 > ch1 (ch1 is in burst mode and ch2 is in cycle-steal mode). figure 9.12 bus handling when multiple channels are operating 9.3.5 number of bus cycle states and dreq pin sample timing number of states in bus cycle: the number of states in the bus cycle when the dmac is the bus master is controlled by the bus state controller just as it is when the cpu is the bus master. the bus cycle in dual address mode is controlled by wait state control register 1 (wcr1) while the single address mode bus cycle is controlled by wait state control register 2 (wcr2). for details, see section 8.9, wait state control. dreq pin sampling timing: normally, when dreq dreq dreq
205 ? dreq dreq dreq dreq dreq dreq dreq dreq figure 9.13 dreq sampling timing in cycle-steal mode (output with dreq level detection and dack active-low) (single address mode, bus cycle = 1 state)
206 ck dreq figure 9.14 dreq sampling timing in cycle-steal mode (output with dreq level detection and dack active-low) (dual address mode, bus cycle = 1 state) ck dreq figure 9.15 dreq sampling timing in cycle-steal mode (output with dreq level detection and dack active-low) (single address mode, bus cycle = 2 states)
207 ck dreq figure 9.16 dreq sampling timing in cycle-steal mode (output with dreq level detection and dack active-low) (dual address mode, bus cycle = 2 states) ck dreq dreq figure 9.17 dreq sampling timing in cycle-steal mode (output with dreq level detection and dack active-low) (single address mode, bus cycle = 2 states + 1 wait state)
208 dmac (r): dmac read cycle dmac (w): dmac write cycle ck dreq figure 9.18 dreq sampling timing in cycle-steal mode (output with dreq level detection and dack active-low) (dual address mode, bus cycle = 2 states + 1 wait state) ck dreq dreq figure 9.19 dreq sampling timing in cycle-steal mode (output with dreq level detection and dack active-low) (single address mode, bus cycle = dram bus cycle (long pitch normal mode))
209 ck dreq dreq figure 9.20 dreq sampling timing in cycle-steal mode (output with dreq level detection and dack active-low) (dual address mode, bus cycle = dram bus cycle (long pitch normal mode)) ck dreq dreq figure 9.21 dreq sampling timing in cycle-steal mode (output with dreq level detection and dack active-low) (single address mode, bus cycle = address/data multiplex i/o bus cycle)
210 ck dreq dreq figure 9.22 dreq sampling timing in cycle-steal mode (output with dreq level detection and dack active-low) (dual address mode, bus cycle = address/data multiplex i/o bus cycle) ? dreq dreq dreq dreq dreq dreq dreq dreq dreq dreq
211 ck dreq figure 9.23 dreq pin sampling timing in burst mode (single address dreq level detection, dack active-low, 1 bus cycle = 2 states) ck dreq figure 9.24 dreq pin sampling timing in burst mode (dual address dreq level detection, dack active-low, dack output in read cycle, 1 bus cycle = 2 states)
212 9.3.6 dma transfer ending conditions the dma transfer ending conditions differ for individual channel ending and ending on all channels together. individual channel ending conditions: there are two ending conditions. a transfer ends when the value of the channel s dma transfer count register (tcr) is 0, or when the de bit in the channel s chcr is cleared to 0. ? ? s chcr. the te bit is not set when this happens. conditions for ending all channels simultaneously: transfers on all channels end when 1) the nmif (nmi flag) bit or ae (address error flag) bit is set to 1 in dmaor, or 2) when the dme bit in dmaor is cleared to 0. ? s de bit is then set to 1, the transfer on that channel will restart. to avoid restarting transfer on a particular channel, keep its de bit cleared to 0. in dual address mode, dma transfer will be halted after the completion of the write cycle that follows the initial read cycle in which the address error occurs. sar, dar, and tcr are updated by the final transfer. ?
213 9.4 examples of use 9.4.1 dma transfer between on-chip ram and memory-mapped external device in the following example, data is transferred from on-chip ram to a memory-mapped external device with an input capture a/compare match a interrupt (imia0) from channel 0 of the 16-bit integrated timer pulse unit (itu) as the transfer request signal. the transfer is performed by dmac channel 3. table 9.7 shows the transfer conditions and register values. table 9.7 transfer conditions and register settings for transfer between on-chip ram and memory-mapped external device transfer conditions register setting transfer source: on-chip ram sar3 h'ffffe00 transfer destination: memory-mapped external device dar3 destination address number of transfers: 8 tcr3 h'0008 transfer destination address: fixed chcr3 h'1805 transfer source address: incremented transfer request source (transfer request signal): itu channel 0 (imia0) bus mode: cycle-steal transfer unit: byte dei interrupt request generated at end of transfer (channel 3 enabled for transfer) channel priority order: fixed (0 > 3 > 2 > 1) (all channels enabled for transfer) dmaor h'0001
214 9.4.2 example of dma transfer between on-chip sci and external memory in this example, receive data of on-chip serial communication interface (sci) channel 0 is transferred to external memory using dmac channel 3. table 9.8 shows the transfer conditions and register settings. table 9.8 transfer conditions and register settings for transfer between on-chip sci and external memory transfer conditions register setting transfer source: rdr0 of on-chip sci0 sar3 h'ffffec5 transfer destination: external memory dar3 destination address number of transfers: 64 tcr3 h'0040 transfer destination address: incremented chcr3 h'4405 transfer source address: fixed transfer request source (transfer request signal): sci0 (rxi0) bus mode: cycle-steal transfer unit: byte dei interrupt request generated at end of transfer (channel 3 enabled for transfer) channel priority order: fixed (0 > 3 > 2 > 1) (all channels enabled for transfer) dmaor h'0001
215 9.4.3 example of dma transfer between on-chip a/d converter and external memory in this example, the results of an a/d conversion by the on-chip a/d converter are transferred to external memory using dmac channel 3. input from channel 0 (an0) is a/d-converted using scan mode. table 9.9 shows the transfer conditions and register settings. table 9.9 transfer conditions and register settings for transfer between on-chip a/d converter and external memory transfer conditions register setting transfer source: addra of on-chip a/d converter sar3 h'ffffee0 (addrah register address) transfer destination: external memory dar3 destination address number of transfers: 16 tcr3 h'0010 transfer destination address: incremented chcr3 h'4d0d transfer source address: fixed transfer request source (transfer request signal): a/d converter (adi) bus mode: cycle-steal transfer unit: word dei interrupt request generated at end of transfer (channel 3 enabled for transfer) channel priority order: fixed (0 > 3 > 2 > 1) (all channels enabled for transfer) dmaor h'0001
216 9.5 usage notes 1. all registers other than the dma operation register (dmaor) and dma channel control registers 0 3 (chcr0 chcr3) should be accessed in word or longword units. 2. before rewriting the rs0 rs3 bits in chcr0 chcr3, first clear the de bit to 0 (when rewriting chcr with a byte access, be sure to set the de bit to 0 in advance). 3. even when an nmi interrupt is input when the dmac is not operating, the nmif bit in dmaor will be set. 4. interrupt during dmac transfer when an interrupt occurs during dmac transfer, the following operation takes place. a. when an nmi interrupt is input, the dmac stops operation and returns the bus to the cpu. the cpu then executes the interrupt handling. b. when an interrupt other than an nmi occurs ? ? ? irq irq ? irq irq ? ? ? ?
217 6. notes on use of the sleep instruction a. operation contents when a dmac bus cycle is entered immediately after executing a sleep instruction, there are cases when dma transfer is not carried out correctly. b. remedy ? ? dreq dreq dreq operation: as shown in figure 9.25, sampling of dreq dreq figure 9.25 dreq sampling points
218 especially, if, as shown in figure 9.26, the dma bus cycle is a full access to dram or if a refresh request is generated, sampling of dreq dreq figure 9.26 example of dreq sampling before output of dack ? ? ? ? remedy: to prevent unnecessary dma transfers, configure the system so that dreq dreq dreq dreq dreq dreq dreq dreq dreq
219 section 10 16-bit integrated timer pulse unit (itu) 10.1 overview the superh microcomputer has an on-chip 16-bit integrated timer pulse unit (itu) with five 16- bit timer channels. 10.1.1 features itu features are listed below: ? can process a maximum of twelve different pulse outputs and ten different pulse inputs. ? has ten general registers (gr), two per channel, that can be set to function independently as output compare or input capture registers. ? selection of eight counter input clock sources for all channels ? internal clock: , /2, /4, /8, ? external clock: tclka, tclkb, tclkc, tclkd ? all channels can be set for the following operating modes: ? compare match waveform output: 0 output/1 output/selectable toggle output (0 output/1 output for channel 2) ? input capture function: selectable rising edge, falling edge, or both rising and falling edges ? counter clearing function: counters can be cleared by a compare match or input capture. ? synchronizing mode: two or more timer counters (tcnt) can be written to simultaneously. two or more timer counters can be simultaneously cleared by a compare match or input capture. counter synchronization functions enable synchronized input/output. ? pwm mode: pwm output can be provided with any duty cycle. when combined with the counter synchronizing function, enables up to five-phase pwm output. ? channel 2 can be set to phase counting mode: two-phase encoder output can be counted automatically. ? channels 3 and 4 can be set in the following modes: ? reset-synchronized pwm mode: by combining channels 3 and 4, 3-phase pwm output is possible with positive and negative waveforms . ? complementary pwm mode: by combining channels 3 and 4, 3-phase pwm output is possible with non-overlapping positive and negative waveforms. ? buffer operation: input capture registers can be double-buffered. output compare registers can be updated automatically. ? high-speed access via internal 16-bit bus: the tcnt, gr, and buffer register (br) 16-bit registers can be accessed at high speed via a 16-bit bus.
220 ? fifteen interrupt sources: ten compare match/input capture interrupts (2 sources per channel) and five overflow interrupts are vectored independently for a total of 15 sources. ? can activate dmac: the compare match/input capture interrupts of channels 0? can start the dmac (one for each of four channels). ? output trigger can be generated for the programmable timing pattern controller (tpc): the compare match/input capture signals of channel 0? can be used as output triggers for the tpc. table 10.1 summarizes the itu functions.
221 table 10.1 itu functions item channel 0 channel 1 channel 2 channel 3 channel 4 counter clocks internal: , /2, /4, /8 external: independently selectable from tclka, tclkb, tclkc, and tclkd general registers (output compare/ input capture dual registers) gra0, grb0 gra1, grb1 gra2, grb2 gra3, grb3 gra4, grb4 buffer registers no no no bra3, brb3 bra4, brb4 input/output pins tioca0, tiocb0 tioca1, tiocb1 tioca2, tiocb2 tioca3, tiocb3 tioca4, tiocb4 output pins no no no no tocxa4, tocxb4 counter clear func- tion (compare match or input capture) gra0/grb0 gra1/grb1 gra2/grb2 gra3/grb3 gra4/grb4 0 yes yes yes yes yes 1 yes yes yes yes yes toggle output yes yes no yes yes input capture function yes yes yes yes yes synchronization yes yes yes yes yes pwm mode yes yes yes yes yes reset-synchronized pwm mode no no no yes yes complementary pwm mode no no no yes yes phase counting mode no no yes no no buffer operation no no no yes yes dmac activation gra0 com- pare match or input capture gra1 com- pare match or input capture gra2 com- pare match or input capture gra3 com- pare match or input capture no interrupt sources (three) ? compare match/input capture a0 ? compare match/input capture b0 ? overflow ? compare match/input capture a1 ? compare match/input capture b1 ? overflow ? compare match/input capture a2 ? compare match/input capture b2 ? overflow ? compare match/input capture a3 ? compare match/input capture b3 ? overflow ? compare match/input capture a4 ? compare match/input capture b4 ? overflow compare match output
222 10.1.2 block diagram itu block diagram (overall diagram): figure 10.1 shows a block diagram of the itu. tocr tstr tsnc tmdr tfcr 16-bit timer channel 0 16-bit timer channel 1 16-bit timer channel 2 16-bit timer channel 3 16-bit timer channel 4 module data bus bus interface internal data bus clock selection counter control and pulse i/o control unit tclka?clkd , / 2, / 4, / 8 tocxa4, tocxb4 tioca0?ioca4 tiocb0?iocb4 imia0?mia4 imib0?mib4 ovi0?vi4 control logic tocr: timer output control register (8 bits) tstr: timer start register (8 bits) tsnc: timer synchronization register (8 bits) tmdr: timer mode register (8 bits) tfcr: timer function control register (8 bits) figure 10.1 block diagram of itu
223 block diagram of channels 0 and 1: itu channels 0 and 1 have the same function. figure 10.2 shows a block diagram of channels 0 and 1. tclka tclkd , /2, /4, /8 clock selection comparator control logic tcntn gran grbn tcrn tiorn tiern tsrn module data bus tiocan tiocbn imian imibn ovin tcntn: timer counter n (16 bits) gran, grbn: general registers an, bn (input capture/output compare dual use) (16 bits 2) tcrn: timer control register n (8 bits) tiorn: timer i/o control register n (8 bits) tiern: timer interrupt enable register n (8 bits) tsrn: timer status register n (8 bits) (n = 0 or 1) figure 10.2 block diagram of channels 0 and 1 (one channel shown)
224 block diagram of channel 2: figure 10.3 shows a block diagram of channel 2. channel 2 is capable of 0 output/1 output only. tclka tclkd , /2, /4, /8 clock selection comparator control logic module data bus tioca2 tiocb2 imia2 imib2 ovi2 tcnt2 gra2 grb2 tcr2 tior2 tier2 tsr2 tcnt2: timer counter 2 (16 bits) gra2, grb2: general registers a2, b2 (input capture/output compare dual use) (16 bits 2) tcr2: timer control register 2 (8 bits) tior2: timer i/o control register 2 (8 bits) tier2: timer interrupt enable register 2 (8 bits) tsr2: timer status register 2 (8 bits) figure 10.3 block diagram of channel 2
225 block diagrams of channels 3 and 4: figure 10.4 shows a block diagram of channel 3; figure 10.5 shows a block diagram of channel 4. tclka tclkd , /2, /4, /8 clock selection comparator control logic module data bus tioca3 tiocb3 imia3 imib3 ovi3 tcnt3 bra3 gra3 tcr3 tior3 tier3 tsr3 brb3 grb3 tcnt3: timer counter 3 (16 bits) gra3, grb3: general registers a3, b3 (input capture/output compare dual use) (16 bits 2) bra3, brb3: buffer registers a3, b3 (input capture/output compare dual use) (16 bits 2) tcr3: timer control register 3 (8 bits) tior3: timer i/o control register 3 (8 bits) tier3: timer interrupt enable register 3 (8 bits) tsr3: timer status register 3 (8 bits) figure 10.4 block diagram of channel 3
226 tclka tclkd , /2, /4, /8 clock selection comparator control logic module data bus tioca4 tiocb4 imia4 imib4 ovi4 tocxa4 tocxb4 gcnt4 bra4 gra4 tcr4 tior4 tier4 tsr4 brb4 grb4 tcnt4: timer counter 4 (16 bits) gra4, grb4: general registers a4, b4 (input capture/output compare dual use) (16 bits 2) bra4, brb4: buffer registers a4, b4 (input capture/output compare dual use) (16 bits 2) tcr4: timer control register 4 (8 bits) tior4: timer i/o control register 4 (8 bits) tier4: timer interrupt enable register 4 (8 bits) tsr4: timer status register 4 (8 bits) figure 10.5 block diagram of channel 4
227 10.1.3 input/output pins table 10.2 summarizes the itu pins. external pin functions should be set with the pin function controller to match to the itu setting. see section 15, pin function controller, for details. itu pins need to be set using the pin function controller (pfc) after the chip is set to itu mode. table 10.2 pin configuration channel name pin name i/o function shared clock input a tclka i external clock a input pin (a-phase input pin in phase counting mode) clock input b tclkb i external clock b input pin (b-phase input pin in phase counting mode) clock input c tclkc i external clock c input pin clock input d tclkd i external clock d input pin 0 input capture/output compare a0 tioca0 i/o gra0 output compare/gra0 input capture/pwm output pin (in pwm mode) input capture/output compare b0 tiocb0 i/o grb0 output compare/grb0 input capture 1 input capture/output compare a1 tioca1 i/o gra1 output compare/gra1 input capture/pwm output pin (in pwm mode) input capture/output compare b1 tiocb1 i/o grb1 output compare/grb1 input capture 2 input capture/output compare a2 tioca2 i/o gra2 output compare/gra2 input capture/pwm output pin (in pwm mode) input capture/output compare b2 tiocb2 i/o grb2 output compare/grb2 input capture 3 input capture/output compare a3 tioca3 i/o gra3 output compare/gra3 input capture/pwm output pin (in pwm mode, complementary pwm mode, or reset-synchronized pwm mode) input capture/output compare b3 tiocb3 i/o grb3 output compare/grb3 input capture/pwm output pin (in complementary pwm mode or reset- synchronized pwm mode) 4 input capture/output compare a4 tioca4 i/o gra4 output compare/gra4 input capture/pwm output pin (in pwm mode, complementary pwm mode or reset-synchronized pwm mode) input capture/output compare b4 tiocb4 i/o grb4 output compare/grb4 input capture/pwm output pin (in complementary pwm mode or reset- synchronized pwm mode) output compare xa4 tocxa4 o pwm output pin (in complementary pwm mode or reset-synchronized pwm mode) output compare xb4 tocxb4 o pwm output pin (in complementary pwm mode or reset-synchronized pwm mode)
228 10.1.4 register configuration table 10.3 summarizes the itu register configuration. table 10.3 register configuration channel name abbrevi- ation r/w initial value address * 1 access size shared timer start register tstr r/w h'e0/h'60 h'5ffff00 8 timer synchro register tsnc r/w h'e0/h'60 h'5ffff01 8 timer mode register tmdr r/w h'80/h'00 h'5ffff02 8 timer function control register tfcr r/w h'c0/h'40 h'5ffff03 8 timer output control register tocr r/w h'ff/h'7f h'5ffff31 8 0 timer control register 0 tcr0 r/w h'80/h'00 h'5ffff04 8 timer i/o control register 0 tior0 r/w h'88/h'08 h'5ffff05 8 timer interrupt enable register 0 tier0 r/w h'f8/h'78 h'5ffff06 8 timer status register 0 tsr0 r/(w) * 2 h'f8/h'78 h'5ffff07 8 timer counter 0 tcnt0 r/w h'00 h'5ffff08 8, 16, 32 h'5ffff09 8, 16, 32 general register a0 gra0 r/w h'ff h'5ffff0a 8, 16, 32 h'5ffff0b 8, 16, 32 general register b0 grb0 r/w h'ff h'5ffff0c 8, 16 h'5ffff0d 8, 16 1 timer control register 1 tcr1 r/w h'80/h'00 h'5ffff0e 8 timer i/o control register 1 tior1 r/w h'88/h'08 h'5ffff0f 8 timer interrupt enable register 1 tier1 r/w h'f8/h'78 h'5ffff10 8 timer status register 1 tsr1 r/(w) * 2 h'f8/h'78 h'5ffff11 8 timer counter 1 tcnt1 r/w h'00 h'5ffff12 8, 16 h'5ffff13 8, 16 general register a1 gra1 r/w h'ff h'5ffff14 8, 16, 32 h'5ffff15 8, 16, 32 general register b1 grb1 r/w h'ff h'5ffff16 8, 16, 32 h'5ffff17 8, 16, 32
229 table 10.3 register configuration (cont) channel name abbrevi- ation r/w initial value address * 1 access size 2 timer control register 2 tcr2 r/w h'80/h'00 h'5ffff18 8 timer i/o control register 2 tior2 r/w h'88/h'08 h'5ffff19 8 timer interrupt enable register 2 tier2 r/w h'f8/h'78 h'5ffff1a 8 timer status register 2 tsr2 r/(w) * 2 h'f8/h'78 h'5ffff1b 8 timer counter 2 tcnt2 r/w h'00 h'5ffff1c 8, 16, 32 h'5ffff1d 8, 16, 32 general register a2 gra2 r/w h'ff h'5ffff1e 8, 16, 32 h'5ffff1f 8, 16, 32 general register b2 grb2 r/w h'ff h'5ffff20 8, 16 h'5ffff21 8, 16 3 timer control register 3 tcr3 r/w h'80/h'00 h'5ffff22 8 timer i/o control register 3 tior3 r/w h'88/h'08 h'5ffff23 8 timer interrupt enable register 3 tier3 r/w h'f8/h'78 h'5ffff24 8 timer status register 3 tsr3 r/(w) * 2 h'f8/h'78 h'5ffff25 8 timer counter 3 tcnt3 r/w h'00 h'5ffff26 8, 16 h'5ffff27 8, 16 general register a3 gra3 r/w h'ff h'5ffff28 8, 16, 32 h'5ffff29 8, 16, 32 general register b3 grb3 r/w h'ff h'5ffff2a 8, 16, 32 h'5ffff2b 8, 16, 32 buffer register a3 bra3 r/w h'ff h'5ffff2c 8, 16, 32 h'5ffff2d 8, 16, 32 buffer register b3 brb3 r/w h'ff h'5ffff2e 8, 16, 32 h'5ffff2f 8, 16, 32 4 timer control register 4 tcr4 r/w h'80/h'00 h'5ffff32 8 timer i/o control register 4 tior4 r/w h'88/h'08 h'5ffff33 8 timer interrupt enable register 4 tier4 r/w h'f8/h'78 h'5ffff34 8 timer status register 4 tsr4 r/(w) * 2 h'f8/h'78 h'5ffff35 8
230 table 10.3 register configuration (cont) channel name abbrevi- ation r/w initial value address * 1 access size 4 (cont) timer counter 4 tcnt4 r/w h'00 h'5ffff36 8, 16 h'5ffff37 8, 16 general register a4 gra4 r/w h'ff h'5ffff38 8, 16, 32 h'5ffff39 8, 16, 32 general register b4 grb4 r/w h'ff h'5ffff3a 8, 16, 32 h'5ffff3b 8, 16, 32 buffer register a4 bra4 r/w h'ff h'5ffff3c 8, 16, 32 h'5ffff3d 8, 16, 32 buffer register b4 brb4 r/w h'ff h'5ffff3e 8, 16, 32 h'5ffff3f 8, 16, 32 notes: * 1 only the values of bits a27 a24 and a8 a0 are valid; bits a23 a9 are ignored. for details on the register addresses, see section 8.3.5, area descriptions. * 2 only 0 can be written to clear flags. 10.2 itu register descriptions 10.2.1 timer start register (tstr) the timer start register (tstr) is an eight-bit read/write register that starts and stops the timer counters (tcnt) of channels 0?. tstr is initialized to h'e0 or h'60 by a reset and in standby mode. bit: 7 6 5 4 3 2 1 0 bit name: str4 str3 str2 str1 str0 initial value: * 11 00 0 00 r/w: r/w r/w r/w r/w r/w note: * undefined
231 ? bits 7? (reserved): cannot be modified. bit 7 is read as undefined. bits 6 and 5 are always read as 1. the write value to bit 7 should be 0 or 1, and the write value to bits 6 and 5 should always be 1. ? bit 4 (count start 4 (str4)): str4 starts and stops tcnt4. bit 4: str4 description 0 tcnt4 is halted (initial value) 1 tcnt4 is counting ? bit 3 (count start 3 (str3)): str3 starts and stops tcnt3. bit 3: str3 description 0 tcnt3 is halted (initial value) 1 tcnt3 is counting ? bit 2 (count start 2 (str2)): str2 starts and stops tcnt2. bit 2: str2 description 0 tcnt2 is halted (initial value) 1 tcnt2 is counting ? bit 1 (count start 1 (str1)): str1 starts and stops tcnt1. bit 1: str1 description 0 tcnt1 is halted (initial value) 1 tcnt1 is counting ? bit 0 (count start 0 (str0)): str0 starts and stops tcnt0. bit 0: str0 description 0 tcnt0 is halted (initial value) 1 tcnt0 is counting
232 10.2.2 timer synchro register (tsnc) the timer synchro register (tsnc) is an eight-bit read/write register that selects timer synchronizing modes for channels 0?. channels for which 1 is set in the corresponding bit will be synchronized. tsnc is initialized to h'e0 or h'60 by a reset and in standby mode. bit: 7 6 5 4 3 2 1 0 bit name: sync4 sync3 sync2 sync1 sync0 initial value: * 11 00 0 00 r/w: r/w r/w r/w r/w r/w note: * undefined ? bits 7? (reserved): bit 7 is read as undefined. bits 6 and 5 are always read as 1. the write value to bit 7 should be 0 or 1, and the write value to bits 6 and 5 should always be 1. ? bit 4 (timer synchro 4 (sync4)): sync4 selects synchronizing mode for channel 4. bit 4: sync4 description 0 the timer counter for channel 4 (tcnt4) operates independently (preset/clear of tcnt4 is independent of other channels) (initial value) 1 channel 4 operates synchronously. synchronized preset/clear of tnct4 enabled. ? bit 3 (timer synchro 3 (sync3)): sync3 selects synchronizing mode for channel 3. bit 3: sync3 description 0 the timer counter for channel 3 (tcnt3) operates independently (preset/clear of tcnt3 is independent of other channels) (initial value) 1 channel 3 operates synchronously. synchronized preset/clear of tnct3 enabled. ? bit 2 (timer synchro 2 (sync2)): sync2 selects synchronizing mode for channel 2. bit 2: sync2 description 0 the timer counter for channel 2 (tcnt2) operates independently (preset/clear of tcnt2 is independent of other channels) (initial value) 1 channel 2 operates synchronously. synchronized preset/clear of tnct2 enabled.
233 ? bit 1 (timer synchro 1 (sync1)): sync1 selects synchronizing mode for channel 1. bit 1: sync1 description 0 the timer counter for channel 1 (tcnt1) operates independently (preset/clear of tcnt1 is independent of other channels) (initial value) 1 channel 1 operates synchronously. synchronized preset/clear of tnct1 enabled. ? bit 0 (timer synchro 0 (sync0)): sync0 selects synchronizing mode for channel 0. bit 0: sync0 description 0 the timer counter for channel 0 (tcnt0) operates independently (preset/clear of tcnt0 is independent of other channels) (initial value) 1 channel 0 operates synchronously. synchronized preset/clear of tnct0 enabled. 10.2.3 timer mode register (tmdr) the timer mode register (tmdr) is an eight-bit read/write register that selects pwm mode for channels 0?, sets phase counting mode for channel 2, and sets the conditions for the overflow flag (ovf). tmdr is initialized to h'80 or h'00 by a reset and in standby mode. bit: 7 6 5 4 3 2 1 0 bit name: mdf fdir pwm4 pwm3 pwm2 pwm1 pwm0 initial value: * 00 00 0 00 r/w: r/w r/w r/w r/w r/w r/w r/w note: * undefined ? bit 7 (reserved): bit 7 is read as undefined. the write value should be 0 or 1. ? bit 6 (phase counting mode (mdf)): mdf selects phase counting mode for channel 2. bit 6: mdf description 0 channel 2 operates normally (initial value) 1 channel 2 operates in phase counting mode
234 when the mdf bit is set to 1 to select phase counting mode, the timer counter (tcnt2) becomes an up/down-counter and the tclka and tclkb pins become count clock input pins. tcnt2 counts on both the rising and falling edges of tclka and tclkb, with increment/decrement chosen as follows: count direction decrement increment tclka pin rising high falling low rising high falling low tclkb pin low rising high falling high falling low rising in phase counting mode, selections for external clock edge made with the ckeg1 and ckeg0 bits in timer control register 2 (tcr2) and the counter clock selection made in the tpsc2 tpsc0 bits are ignored. the phase counting mode described above takes priority. settings for counter clear conditions in the cclr1 and cclr0 bits in tcr2 and settings for timer i/o control register 2 (tior2), timer interrupt enable register (tier2), and timer status register 2 (tsr2) compare match/input capture functions and interrupts, however, are valid even in phase counting mode. ? bit 5 (flag direction (fdir)): fdir selects the setting condition for the overflow flag (ovf) in timer status register 2 (tsr2). this bit is valid no matter which mode channel 2 is operating in. bit 5: fdir description 0 ovf of tsr2 is set to 1 when tcnt2 overflows or underflows (initial value) 1 ovf of tsr2 is set to 1 when tcnt2 overflows ? bit 4 (pwm mode 4 (pwm4)): pwm4 selects pwm mode for channel 4. when the pwm4 bit is set to 1 and pwm mode is entered, the tioca4 pin becomes a pwm output pin. 1 is output on a compare match of general register a4 (gra4); 0 is output on a compare match of general register b4 (grb4). when complementary pwm mode or reset-synchronized pwm mode is set by the cmd1 and cmd0 bits in the timer function control register (tfcr), the setting of this bit is ignored in favor of the settings of cmd1 and cmd0. bit 4: pwm4 description 0 channel 4 operates normally (initial value) 1 channel 4 operates in pwm mode
235 ? bit 3 (pwm mode 3 (pwm3)): pwm3 selects the pwm mode for channel 3. when the pwm3 bit is set to 1 and pwm mode is entered, the tioca3 pin becomes a pwm output pin. 1 is output on a compare match of general register a3 (gra3); 0 is output on a compare match of general register b3 (grb3). when complementary pwm mode or reset-synchronized pwm mode is set by the cmd1 and cmd0 bits in the timer function control register (tfcr), the setting of this bit is ignored in favor of the settings of cmd1 and cmd0. bit 3: pwm3 description 0 channel 3 operates normally (initial value) 1 channel 3 operates in pwm mode ? bit 2 (pwm mode 2 (pwm2)): pwm2 selects the pwm mode for channel 2. when the pwm2 bit is set to 1 and pwm mode is entered, the tioca2 pin becomes a pwm output pin. 1 is output on a compare match of general register a2 (gra2); 0 is output on a compare match of general register b2 (grb2). bit 2: pwm2 description 0 channel 2 operates normally (initial value) 1 channel 2 operates in pwm mode ? bit 1 (pwm mode 1 (pwm1)): pwm1 selects the pwm mode for channel 1. when the pwm1 bit is set to 1 and pwm mode is entered, the tioca1 pin becomes a pwm output pin. 1 is output on a compare match of general register a1 (gra1); 0 is output on a compare match of general register b1 (grb1). bit 1: pwm1 description 0 channel 1 operates normally (initial value) 1 channel 1 operates in pwm mode ? bit 0 (pwm mode 0 (pwm0)): pwm0 selects the pwm mode for channel 0. when the pwm0 bit is set to 1 and pwm mode is entered, the tioca0 pin becomes a pwm output pin. 1 is output on a compare match of general register a0 (gra0); 0 is output on a compare match of general register b0 (grb0). bit 0: pwm0 description 0 channel 0 operates normally (initial value) 1 channel 0 operates in pwm mode
236 10.2.4 timer function control register (tfcr) the timer function control register (tfcr) is an 8-bit read/write register that selects complementary pwm/reset-synchronized pwm for channels 3 and 4 and sets the buffer operation. tfcr is initialized to h'c0 or h'40 by a reset and in standby mode. bit: 7 6 5 4 3 2 1 0 bit name: cmd1 cmd0 bfb4 bfa4 bfb3 bfa3 initial value: * 10 00 0 00 r/w: r/w r/w r/w r/w r/w r/w note: * undefined ? bits 7 and 6 (reserved): bit 7 is read as undefined. bit 6 is always read as 1. the write value to bit 7 should be 0 or 1. the write value to bit 6 should always be 1. ? bits 5 and 4 (combination mode 1 and 0 (cmd1 and cmd0)): cmd1 and cmd0 select complementary pwm mode or reset-synchronized mode for channels 3 and 4. set the complementary pwm/reset-synchronized pwm mode while the timer counter (tcnt) being used is off. when these bits are used to set complementary pwm/reset-synchronized pwm mode, they take priority over the pwm4 and pwm3 bits in tmdr. while the complementary pwm/reset-synchronized pwm mode settings and the sync4 and sync3 bit settings of the timer synchro register (tsnc) are valid simultaneously, when complementary pwm mode is set, channels 3 and 4 should not be set to operate simultaneously (the sync 4 and sync 3 bits in tsnc should not both be set to 1). bit 5: cmd1 bit 4: cmd0 description 0 0 channels 3 and 4 operate normally (initial value) 1 channels 3 and 4 operate normally 1 0 channels 3 and 4 operate together in complementary pwm mode 1 channels 3 and 4 operate together in reset-synchronized pwm mode
237 ? bit 3 (buffer mode b4 (bfb4)): bfb4 selects buffer mode for grb4 and brb4 in channel 4. bit 3: bfb4 description 0 grb4 operates normally in channel 4 (initial value) 1 grb4 and brb4 operate in buffer mode in channel 4 ? bit 2 (buffer mode a4 (bfa4)): bfa4 selects buffer mode for gra4 and bra4 in channel 4. bit 2: bfa4 description 0 gra4 operates normally in channel 4 (initial value) 1 gra4 and bra4 operate in buffer mode in channel 4 ? bit 1 (buffer mode b3 (bfb3)): bfb3 selects buffer mode for grb3 and brb3 in channel 3. bit 1: bfb3 description 0 grb3 operates normally in channel 3 (initial value) 1 grb3 and brb3 operate in buffer mode in channel 3 ? bit 0 (buffer mode a3 (bfa3)): bfa3 selects buffer mode for gra3 and bra3 in channel 3. bit 0: bfa3 description 0 gra3 operates normally in channel 3 (initial value) 1 gra3 and bra3 operate in buffer mode in channel 3
238 10.2.5 timer output control register (tocr) the timer output control register (tocr) is an eight-bit read/write register that inverts the output level in complementary pwm mode/reset-synchronized pwm mode. setting bits ols3 and ols4 is valid only in complementary pwm mode and reset-synchronized pwm mode. in other output situations, these bits are ignored. tocr is initialized to h'ff or h'7f by a reset and in standby mode. bit: 7 6 5 4 3 2 1 0 bit name: ols4 ols3 initial value: * 11 11 1 11 r/w: r/w r/w note: * undefined ? bits 7? (reserved): bit 7 is read as undefined. bits 6? are always read as 1. the write value to bit 7 should be 0 or 1. the write value to bits 6? should always be 1. ? bit 1 (output level select 4 (ols4)): ols4 selects the output level for complementary pwm mode or reset-synchronized pwm mode. bit 1: ols4 description 0 tioca3, tioca4, and tiocb4 are inverted and output 1 tioca3, tioca4, and tiocb4 are output directly (initial value) ? bit 0 (output level select 3 (ols3)): ols3 selects the output level for complementary pwm mode or reset-synchronized pwm mode. bit 0: ols3 description 0 tiocb3, tocxa4, and tocxb4 are inverted and output 1 tiocb3, tocxa4, and tocxb4 are output directly (initial value)
239 10.2.6 timer counters (tcnt) the itu has five 16-bit timer counters (tcnt), one for each channel. each tcnt is a 16-bit read/write counter that counts by input from a clock source. the clock source is selected by timer prescaler bits 2? (tpsc2?psc0) in the timer control register (tcr). tcnt0 and tcnt 1 are strictly up-counters. up/down-counting occurs for tcnt2 when phase counting mode is selected, or for tcnt3 and tcnt 4 when complementary pwm mode is selected. in other modes, they are up-counters. tcnt can be cleared to h'0000 by compare match with the corresponding general register a or b (gra, grb) or input capture to gra or grb (counter clear function). when tcnt overflows (changes from h'ffff to h'0000), the overflow flag (ovf) in the timer status register (tsr) is set to 1. the ovf of the corresponding channel tsr is also set to 1 when tcnt underflows (changes from h'0000 to h'ffff). tcnt is connected to the cpu by a 16-bit bus, so it can be written or read by either word access or byte access. tcnt is initialized to h'0000 by a reset and in standby mode. table 10.4 timer counters (tcnt) channel abbreviation function 0 tcnt0 increment counter 1 tcnt1 2 tcnt2 phase counting mode: increment/decrement all others: increment 3 tcnt3 complementary pwm mode: increment/decrement 4 tcnt4 all others: increment bit: 15 14 13 12 11 10 9 8 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w
240 10.2.7 general registers a and b (gra and grb) each of the five itu channels has two 16-bit general registers (gr) for a total of ten registers. each gr is a 16-bit read/write register that can function as either an output compare register or an input capture register. the function is selected by settings in the timer i/o control register (tior). when a general register (gra/grb) is used as an output compare register, its value is constantly compared with the timer counter (tcnt) value. when the two values match (compare match), the imfa/imfb bit is set to 1 in the timer status register (tsr). if compare match output is selected in tior, a specified value is output at the output compare pin. when a general register is used as an input capture register, an external input capture signal is detected and the tcnt value is stored. the imfa/imfb bit in the corresponding tsr is set to 1 at the same time. the valid edge or edges of the input capture signal are selected in tior. the tior setting is ignored when set for pwm mode, complementary pwm mode, or reset- synchronized pwm mode. general registers are connected to the cpu by a 16-bit bus, so general registers can be written or read by either word access or byte access. general registers are initialized as output compare registers (no pin output) by a reset and in standby mode. the initial value is h'ffff. table 10.5 general registers a and b (gra and grb) channel abbreviation function 0 gra0, grb0 output compare/input capture dual register 1 gra1, grb1 2 gra2, grb2 3 gra3, grb3 output compare/input capture dual register. can also be set for buffer 4 gra4, grb4 operation in combination with the buffer registers (bra, brb) bit: 15 14 13 12 11 10 9 8 bit name: initial value: 1 1 1 1 1 1 1 1 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: initial value: 1 1 1 1 1 1 1 1 r/w: r/w r/w r/w r/w r/w r/w r/w r/w
241 10.2.8 buffer registers a and b (bra, brb) each buffer register is a 16-bit read/write register that is used in buffer mode. the itu has four buffer registers, two each for channels 3 and 4. buffer operation can be set independently by the timer function control register (tfcr) bits bfb4, bfa4, bfb3, and bfb3. the buffer registers are paired with the general registers and their function changes automatically to match the function of corresponding general register. the buffer registers are connected to the cpu by a 16-bit bus, so they can be written or read by either word or byte access. buffer registers are initialized to h'ffff by a reset and in standby mode. table 10.6 buffer registers a and b (bra, brb) channel abbreviation function 3 bra3, brb3 when used for buffer operation: 4 bra4, brb4 when the corresponding gra and grb are output compare registers, the buffer registers function as output compare buffer registers that can automatically transfer the bra and brb values to gra and grb upon a compare match. when the corresponding gra and grb are input capture registers, the buffer registers function as input capture buffer registers that can automatically transfer the values stored until an input capture in the gra and grb to the bra and brb. bit: 15 14 13 12 11 10 9 8 bit name: initial value: 1 1 1 1 1 1 1 1 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: initial value: 1 1 1 1 1 1 1 1 r/w: r/w r/w r/w r/w r/w r/w r/w r/w
242 10.2.9 timer control register (tcr) the itu has five 8-bit timer control registers (tcr), one for each channel. tcr is an 8-bit read/write register that selects the timer counter clock, the edges of the external clock source, and the counter clear source. tcr is initialized to h'80 or h'00 by a reset and in standby mode. table 10.7 timer control register (tcr) channel abbrevi- ation function 0 tcr0 1 tcr1 2 tcr2 3 tcr3 4 tcr4 bit: 7 6 5 4 3 2 1 0 bit name: cclr1 cclr0 ckeg1 ckeg0 tpsc2 tpsc1 tpsc0 initial value: * 00 00 0 00 r/w: r/w r/w r/w r/w r/w r/w r/w note: * undefined ? bit 7 (reserved): bit 7 is read as undefined. the write value should be 0 or 1. tcr controls the tcnts. the tcrs have the same functions on all channels. when channel 2 is set for phase counting mode, setting the ckeg1, ckeg2, and tpsc2 tpsc0 bits will have no effect.
243 ? bits 6 and 5 (counter clear 1 and 0 (cclr1 and cclr0)): cclr1 and cclr0 select the counter clear source. bit 6: cclr1 bit 5: cclr0 description 0 0 tcnt is not cleared (initial value) 1 tcnt is cleared by general register a (gra) compare match or input capture * 1 1 0 tcnt is cleared by general register b (grb) compare match or input capture * 1 1 synchronizing clear: tcnt is cleared in synchronization with clear of other timer counters operating in sync * 2 notes: * 1 when gr is functioning as an output compare register, tcnt is cleared upon a compare match. when functioning as an input capture register, tcnt is cleared upon input capture. * 2 the timer synchro register (tsnc) sets the synchronization. ? bits 4 and 3 (external clock edge 1/0 (ckeg1 and ckeg0)): ckeg1 and ckeg0 select external clock input edge. when channel 2 is set for phase counting mode, settings of the ckeg1 and ckeg0 bits in tcr are ignored and the phase counting mode operation takes priority. bit 4: ckeg1 bit 3: ckeg0 description 0 0 count rising edges (initial value) 1 count falling edges 1 count both rising and falling edges ? bits 2? (timer prescaler 2? (tps2?ps0)): tps2?ps0 select the counter clock source. when tpsc2 = 0 and an internal clock source is selected, the timer counts only falling edges. when tpsc2 = 1 and an external clock is selected, the count edge is as set by ckeg1 and ckeg0. when phase counting mode is selected for channel 2 (the mdf bit in the timer mode register is 1), the settings of tpsc2?psc0 in tcr2 are ignored and the phase counting operation takes priority.
244 bit 2: tpsc2 bit 1: tpsc1 bit 0: tpsc0 counter clock (and cycle when = 10 mhz) 0 0 0 internal clock (initial value) 1 internal clock /2 1 0 internal clock /4 1 internal clock /8 1 0 0 external clock a (tclka) 1 external clock b (tclkb) 1 0 external clock c (tclkc) 1 external clock d (tclkd) 10.2.10 timer i/o control register (tior) the timer i/o control register (tior) is an eight-bit read/write register that selects the output compare or input capture function for general registers gra and grb. it also selects the function of the tioca and tiocb pins. if output compare is selected, tior also selects the output settings. if input capture is selected, tior also selects the input capture edge. tior is initialized to h'88 or h'08 by a reset and in standby mode. each itu channel has one tior. table 10.8 timer i/o control register (tior) channel abbrevi- ation function 0 tior0 1 tior1 2 tior2 3 tior3 4 tior4 bit: 7 6 5 4 3 2 1 0 bit name: iob2 iob1 iob0 ioa2 ioa1 ioa0 initial value: * 00 01 0 00 r/w: r/w r/w r/w r/w r/w r/w note: * undefined ? bit 7 (reserved): bit 7 is read as undefined. the write value should be 0 or 1. tior controls the grs. some functions vary during pwm. when channels 3 and 4 are set for complementary pwm mode/reset- synchronized pwm mode, tior3 and tior4 settings are not valid.
245 ? bits 6? (i/o control b2?0 (iob2?ob0)): iob2?ob0 selects the grb function. bit 6: iob2 bit 5: iob1 bit 4: iob0 grb function 0 0 0 compare match with pin output disabled (initial value) 1 0 output at grb compare match * 1 1 0 1 output at grb compare match * 1 1 output toggles at grb compare match (1 output for channel 2 only) * 1 * 2 1 0 0 grb captures rising edge of input 1 grb captures falling edge of input 1 0 grb captures both edges of input 1 notes: * 1 after reset, the value output is 0 until the first compare match occurs. * 2 channel 2 has no compare-match driven toggle output function. if it is set for toggle, 1 is automatically selected as the output. ? bit 3 (reserved): bit 3 always is read as 1. the write value should always be 1. ? bits 2? (i/o control a2?0 (ioa2?oa0)): ioa2?oa0 select the grb function. bit 2: ioa2 bit 1: ioa1 bit 0: ioa0 gra function 0 0 0 compare match with pin output disabled (initial value) 1 0 output at gra compare match * 1 1 0 1 output at gra compare match * 1 1 output toggles at gra compare match (1 output for channel 2 only) * 1 * 2 1 0 0 gra captures rising edge of input 1 gra captures falling edge of input 1 0 gra captures both edges of input 1 notes: * 1 after reset, the value output is 0 until the first compare match occurs. * 2 channel 2 has no compare-match driven toggle output function. if it is set for toggle, 1 is automatically selected as the output. grb is an output compare register grb is an input capture register gra is an output compare register gra is an input capture register
246 10.2.11 timer status register (tsr) the timer status register (tsr) is an eight-bit read/write register containing flags that indicate timer counter (tcnt) overflow/underflow and general register (gra/grb) compare match or input capture. these flags are interrupt sources. if the interrupt is enabled by the corresponding bit in the timer interrupt enable register (tier), an interrupt request is sent to the cpu. tsr is initialized to h'f8 or h'78 by a reset and in standby mode. each itu channel has one tsr. table 10.9 timer status register (tsr) channel abbreviation function 0 tsr0 tsr indicates input capture, compare match and 1 tsr1 overflow status. 2 tsr2 3 tsr3 4 tsr4 bit: 7 6 5 4 3 2 1 0 bit name: ovf imfb imfa initial value: * 1 11 11 0 00 r/w: r/(w) * 2 r/(w) * 2 r/(w) * 2 notes: * 1 undefined * 2 only 0 can be written, to clear the flag. ? bits 7? (reserved): bit 7 is read as undefined. bits 6? are always read as 1. the write value to bit 7 should be 0 or 1. the write value to bits 6? should always be 1. ? bit 2 (overflow flag (ovf)): ovf indicates that a tcnt overflow/underflow has occurred. bit 2: ovf description 0 clearing condition: read ovf when ovf = 1, then write 0 in ovf (initial value) 1 setting condition: tcnt overflow from h'ffff to h'0000 or underflow from h'0000 to h'ffff note: a tcnt underflow occurs when the tcnt up/down-counter is functioning. it may occur in the following cases: (1) when channel 2 is set to phase counting mode (mdf bit in tmdr is 1), or (2) when channel 3 and 4 are set to complementary pwm mode (cmd1 bit in tfcr is 1 and cmd0 bit is 0).
247 ? bit 1 (input capture/compare match b (imfb)): imfb indicates a grb compare match or input capture. bit 1: imfb description 0 clearing condition: read imfb when imfb = 1, then write 0 in imfb (initial value) 1 setting conditions: ? grb is functioning as an output compare register and tcnt = grb ? grb is functioning as an input capture register and the value of tcnt is transferred to grb by an input capture signal ? bit 0 (input capture/compare match a (imfa)): imfa indicates a gra compare match or input capture. bit 0: imfa description 0 clearing condition: read imfa when imfa = 1, then write 0 in imfa (initial value) dmac is activated by an imia interrupt (only channels 0 3) 1 setting conditions: ? gra is functioning as an output compare register and tcnt = gra ? gra is functioning as an input capture register and the value of tcnt is transferred to gra by an input capture signal 10.2.12 timer interrupt enable register (tier) the timer status interrupt enable register (tier) is an eight-bit read/write register that controls enabling/disabling of overflow interrupt requests and general register compare match/input capture interrupt requests. tier is initialized to h'f8 or h'78 by a reset and in standby mode. each itu channel has one tier.
248 table 10.10 timer interrupt enable register (tier) channel abbreviation function 0 tier0 tier controls interrupt enabling/disabling 1 tier1 2 tier2 3 tier3 4 tier4 bit: 7 6 5 4 3 2 1 0 bit name: ovie imieb imiea initial value: * 11 11 0 00 r/w: r/w r/w r/w note: * undefined ? bits 7? (reserved): bit 7 is read as undefined. bits 6? are always read as 1. the write value to bit 7 should be 0 or 1. the write value to bits 6? should always be 1. ? bit 2 (overflow interrupt enable (ovie)): when the tsr overflow flag (ovf) is set to 1, ovie enables or disables interrupt requests from ovf. bit 2: ovie description 0 disables interrupt requests by ovf (initial value) 1 enables interrupt requests from ovf ? bit 1 (input capture/compare match interrupt enable b (imieb)): when the imfb bit in tsr is set to 1, imieb enables or disables interrupt requests by imfb. bit 1: imieb description 0 disables interrupt requests by imfb (imib) (initial value) 1 enables interrupt requests by imfb (imib) ? bit 0 (input capture/compare match interrupt enable a (imiea)): when the imfa bit in tsr is set to 1, imiea enables or disables interrupt requests by imfa. bit 0: imiea description 0 disables interrupt requests by imfa (imia) (initial value) 1 enables interrupt requests by imfa (imia)
249 10.3 cpu interface 10.3.1 16-bit accessible registers the timer counters (tcnt), general registers a and b (gra, grb), and buffer registers a and b (bra, brb) are 16-bit registers. the sh cpu can access these registers a word at a time using a 16-bit data bus. byte access is also possible. read and write operations performed on tcnt in word units are shown in figures 10.6 and 10.7. byte-unit read and write operations on tcnth and tcntl are shown in figures 10.8 to 10.11. tcnth tcntl h l bus interface h l cpu internal data bus module data bus figure 10.6 tcnt access (cpu to tcnt (word)) tcnth tcntl h l bus interface h l cpu internal data bus module data bus figure 10.7 tcnt access (tcnt to cpu (word)) tcnth tcntl h l bus interface h l cpu internal data bus module data bus figure 10.8 tcnt access (cpu to tcnt (upper byte))
250 tcnth tcntl h l bus interface h l cpu internal data bus module data bus figure 10.9 tcnt access (cpu to tcnt (lower byte)) tcnth tcntl h l bus interface h l cpu internal data bus module data bus figure 10.10 tcnt access (tcnt to cpu (upper byte)) tcnth tcntl h l bus interface h l cpu internal data bus module data bus figure 10.11 tcnt access (tcnt to cpu (lower byte))
251 10.3.2 8-bit accessible registers all registers other than the tcnt register, general registers, and buffer registers are 8-bit registers. these are connected to the cpu by an 8-bit data bus. figures 10.12 and 10.13 illustrate reading and writing in byte units with the timer control register (tcr). these registers must be accessed by byte access. tcr bus interface internal data bus module data bus cpu figure 10.12 tcr access (cpu to tcr) tcr bus interface internal data bus module data bus cpu figure 10.13 tcr access (tcr to cpu )
252 10.4 operation 10.4.1 overview the operation modes are described below. ordinary operation: each channel has a timer counter (tcnt) and general register (gr). the tcnt is an up-counter and can also operate as a free-running counter, periodic counter, or external event counter. general registers a and b (gra and grb) can be used as output compare registers or input capture registers. synchronized operation: the tcnt of a channel set for synchronized operation perform synchronized presetting. when any tcnt of a channel operating in the synchronized mode is rewritten, the tcnts in other channels are simultaneously rewritten as well. the cclr1 and cclr0 bits of the timer control register of multiple channels set for synchronous operation can be set to clear the tcnts simultaneously. pwm mode: in pwm mode, a pwm waveform is output from the tioca pin. output becomes 1 upon compare match a and 0 upon compare match b. gra and grb can be set so that the pwm waveform output has a duty cycle between 0% and 100%. when set for pwm mode, the gra and grb automatically become output compare registers. reset-synchronized pwm mode: three pairs of positive and negative pwm waveforms can be obtained using channels 3 and 4 (the three phases of the pwm waveform share a transition point on one side). when set for reset-synchronized pwm mode, gra3, grb3, gra4, and grb4 automatically become output compare registers. the tioca3, tiocb3, tioca4, tocxa4, tiocb4, and tocxb4 pins also become pwm output pins and tcnt3 becomes an up-counter. tcnt4 functions independently (although gra and grb are isolated from tcnt4). complementary pwm mode: three pairs of complementary positive and negative pwm waveforms whose positive and negative phases do not overlap can be obtained using channels 3 and 4. when set for complementary pwm mode, gra3, grb3, gra4, and grb4 automatically become output compare registers. the tioca3, tiocb3, tioca4, tocxa4, tiocb4, and tocxb4 pins also become pwm output pins while tcnt3 and tcnt4 become up-counters. phase counting mode: in phase counting mode, the phase differential between two clocks input from the tclka and tclkb pins is detected and the tcnt2 operates as an up/down-counter. in phase counting mode, the tclka and tclkb pins become clock inputs and tcnt2 functions as an up/down-counter. buffer mode: ? when gr is an output compare register: the br value of each channel is transferred to gr when a compare match occurs.
253 ? when gr is an input capture register: the tcnt value is transferred to gr when an input capture occurs and simultaneously the value previously stored in gr is transferred to br. ? complementary pwm mode: when tcnt3 and tcnt4 change count directions, the br value is transferred to gr. ? reset-synchronized pwm mode: the br value is transferred to gr upon a gra3 compare match. 10.4.2 basic functions counter operation: when a start bit (str0?tr4) in the timer start register (tstr) is set to 1, the corresponding timer counter (tcnt) starts counting. there are two counting modes: a free- running mode and a periodic mode. ? procedure for selecting counting mode (figure 10.14): 1. set bits tpsc2?psc0 in tcr to select the counter clock source. if an external clock source is selected, set bits ckeg1 and ckeg0 in tcr to select the desired edge of the external clock signal. 2. to operate as a periodic counter, set cclr1 and cclr0 in tcr to select whether to clear tcnt at gra compare match or grb compare match. 3. set gra or grb selected in step 2 as an output compare register using the timer i/o control register (tior). 4. write the desired cycle value in gra or grb selected in step 1. 5. set the str bit in tstr to 1 to start counting.
254 counting mode selection select counter clock periodic counter select counter clear source select output compare register set period start counting start counting counting? no yes free-running counter periodic counter free-running counter (5) (5) (4) (3) (2) (1) figure 10.14 procedure for selecting the counting mode ? free-running count and periodic count a reset of the counters for channels 0? leaves them all in free-running mode. when a corresponding bit in tstr is set to 1, the corresponding timer counter operates as a free- running counter and begins to increment. when the count wraps around from h'ffff to h'0000, the overflow flag (ovf) in the timer status register (tsr) is set to 1. if the ovie bit in the timer's corresponding interrupt enable register (tier) is set to 1, an interrupt request will be sent to the cpu. after tcnt overflows, counting continues from h'0000. figure 10.15 shows an example of free-running counting. periodic counter operation is obtained for a given channel's tcnt by selecting compare match as a tcnt clear source. (set gra or grb for period setting to output compare register and select counter clear upon compare match using the cclr1 and cclr0 bits in the timer control register (tcr).) after setting, tcnt begins incrementing as a periodic counter when the corresponding bit in tstr is set to 1. when the count matches gra or grb, the imfa/imfb bit in tsr is set to 1 and the counter is automatically cleared to h'0000. if the imiea/imieb bit of the corresponding tier is set to 1 at this point, an interrupt request will be sent to the cpu. after the compare match, tcnt continues counting from h'0000. figure 10.16 shows an example of periodic counting.
255 h'ffff h'0000 str0 str4 ovf tcnt value time figure 10.15 free-running counter operation gr h'0000 str0 str4 imf tcnt value time counter cleared by gr compare match figure 10.16 periodic counter operation ? tcnt counter timing internal clock source: bits tpsc2?psc0 in tcr select the system clock (ck) or one of three internal clock sources ( /2, /4, /8) obtained by prescaling the system clock. figure 10.17 shows the timing. external clock source: the external clock input pin (tclka?clkd) source is selected by bits tpsc2?psc0 in tcr and its valid edges are selected with the ckeg1 and ckeg0 bits in tcr. the rising edge, falling edge, or both edges can be selected. the pulse width of the external clock signal must be at least 1.5 system clocks when a single edge is selected and at least 2.5 system clocks when both edges are selected. shorter pulses will not be counted correctly. figure 10.18 shows the timing when both edges are detected.
256 ck n 1 n n + 1 internal clock tcnt input clock tcnt value figure 10.17 count timing for internal clock sources ck n 1 n n + 1 external clock input pin tcnt input clock tcnt figure 10.18 count timing for external clock sources (both-edge detection) compare-match waveform output function: for itu channels 0, 1, 3, and 4, the output from the corresponding tioca and tiocb pins upon compare matches a and b can be in three modes: 0-level output, 1-level output, or toggle. toggle output cannot be selected for channel 2. ? procedure for selecting the waveform output mode (figure 10.19): 1. set tior to select 0 output, 1 output, or toggle output for compare match output. the compare match output pin will output 0 until the first compare match occurs. 2. set a value in gra or grb to select the compare match timing. 3. set the str bit in tstr to 1 to start counting.
257 output selection select waveform output mode select output timing start counting waveform output (1) (2) (3) figure 10.19 procedure for selecting compare match waveform output mode ? waveform output operation figure 10.20 illustrates 0 output/1 output. in the example, tcnt is a free-running counter, 0 is output upon compare match a, and 1 is output upon compare match b. when the pin level matches the set level, the pin level does not change. figure 10.21 shows an example of toggle output. in the figure, tcnt operates as a periodic counter cleared by grb compare match with toggle output at both compare match a and compare match b. h'ffff tiocb tcnt value time grb gra tioca does not change does not change 1 output does not change does not change 0 output figure 10.20 example of 0 output/1 output
258 tiocb tcnt value time grb gra tioca counter cleared at grb compare match toggle output toggle output figure 10.21 example of toggle output ? compare match output timing the compare match signal is generated in the last state in which tcnt and the general register match (when tcnt changes from the matching value to the next value). when a compare match signal is generated, the output value set in tior is output to the output compare pin (tioca, tiocb). accordingly, when tcnt matches a general register, the compare match signal is not generated until the next counter clock pulse. figure 10.22 shows the output timing of the compare match signal. n n n 1 ck tcnt input clock tcnt gr compare match signal tioca tiocb figure 10.22 compare match signal output timing
259 input capture mode: in input capture mode, the counter value is captured into a general register when the input edge is detected at an input capture/output compare pin (tioca, tiocb). detection can take place on the rising edge, falling edge, or both edges. the pulse width and cycle can be measured by using the input capture function. ? procedure for selecting input capture mode (figure 10.23) 1. set tior to select the input capture function of gr and select the rising edge, falling edge, or both edges as the input edge of the input capture signal. put the corresponding port into input-capture mode using the pin function controller before setting tior. 2. set the str bit in tstr to 1 to start the tcnt count. input selection select input-capture input (1) (2) start counting capture figure 10.23 procedure for selecting input capture mode
260 ? input capture operation figure 10.24 illustrates input capture. the falling edge of tiocb and both edges of tioca are selected as input capture edges. in the example, tcnt is set to clear at grb input capture. counter cleared by tiocb input (falling edge) tcnt value h'0180 h'0160 h'0005 h'0000 tiocb tioca gra grb h'0005 h'0160 h'0180 time figure 10.24 input capture operation
261 ? input capture timing input capture on the rising edge, falling edge, or both edges can be selected by settings in tior. figure 10.25 shows the timing when the rising edge is selected. the pulse width of the input capture signal must be at least 1.5 system clocks for single-edge capture, and 2.5 system clocks for capture of both edges. n ck input capture input tcnt input capture signal gra/grb n figure 10.25 input capture signal timing
262 10.4.3 synchronizing mode in synchronizing mode, two or more timer counters can be rewritten simultaneously (synchronized preset). multiple timer counters can also be cleared simultaneously using tcr settings (synchronized clear). synchronizing mode enables the general registers to be incremented with a single time base. all five channels can be set for synchronous operation. procedure for selecting synchronizing mode (figure 10.26): 1. set 1 in the sync bit of the timer synchro register (tsnc) to use the channels in the synchronizing mode. 2. when a value is written in tcnt in any of the synchronized channels, the same value is simultaneously written in tcnt in the other channels. 3. set the counter to clear with compare match/input capture using bits cclr1 and cclr0 in tcr. 4. set the counter clear source to synchronized clear using the cclr1 and cclr0 bits. 5. set the str bits in tstr to 1 to start the tcnt count. select counter clear source channel that generated clear source? no yes select synchronizing mode set synchronizing mode synchronized preset set tcnt start counting select counter clear source start counting counter clear synchronized clear synchronizing preset synchronized clear (1) (2) (3) (5) (4) (5) figure 10.26 procedure for selecting synchronizing mode
263 synchronized operation: figure 10.27 shows an example of synchronized operation. channels 0, 1, and 2 are set to synchronized operation and pwm output. channel 0 is set for a counter clear upon compare match with grb0. channels 1 and 2 are set for counter clears by synchronizing clears. accordingly, their timers are sync preset, then sync cleared by a grb0 compare match, and then a three-phase pwm waveform is output from the tioca0, tioca1, and tioca2 pins. see section 10.4.4, pwm mode, for details on pwm mode. tcnt0 tcnt2 values time tioca0 synchronized clear on grb0 compare match grb0 grb1 gra0 grb2 gra1 gra2 tioca1 tioca2 figure 10.27 example of synchronized operation
264 10.4.4 pwm mode pwm mode is controlled using both gra and grb in pairs. the pwm waveform is output from the tioca output pin. the pwm waveform? 1 output timing is set in gra and the 0 output timing is set in grb. a pwm waveform with a duty cycle between 0% and 100% can be output from the tioca pin by selecting either compare match gra or grb as the counter clear source for the timer counter. all five channels can be set to pwm mode. table 10.11 lists the combinations of pwm output pins and registers. note that when gra and grb are set to the same value, the output will not change even if a compare match occurs. table 10.11 combinations of pwm output pins and registers channel output pin 1 output 0 output 0 tioca0 gra0 grb0 1 tioca1 gra1 grb1 2 tioca2 gra2 grb2 3 tioca3 gra3 grb3 4 tioca4 gra4 grb4 procedure for selecting pwm mode (figure 10.28): 1. set bits tpsc2?psc0 in tcr to select the counter clock source. if an external clock source is selected, set bits ckeg1 and ckeg0 in tcr to select the desired edge of the external clock signal. 2. set cclr1 and cclr0 in tcr to select the counter clear source. 3. set the time at which the pwm waveform should go to 1 in gra. 4. set the time at which the pwm waveform should go to 0 in grb. 5. set the pwm bit in tmdr to select pwm mode. when pwm mode is selected, regardless of the contents of tior, gra and grb become output compare registers specifying the times at which the pwm waveform goes high and low. tioca becomes a pwm output pin. tiocb functions according to the setting of bits iob1 and iob0 in tior. 6. set the str bit in tstr to start the tcnt count.
265 (1) (2) (3) (4) (5) (6) pwm mode select counter clock set gra set grb select pwm mode start counting pwm mode select counter clear source figure 10.28 procedure for selecting pwm mode pwm mode operation: figure 10.29 illustrates pwm mode operation. when pwm mode is set, the tioca pin becomes the output pin. output is 1 when tcnt matches gra, and 0 when tcnt matches grb. tcnt can be cleared by compare match with either gra or grb. this can be used in both free-running and synchronized operation. figure 10.30 shows examples of pwm waveforms output with 0% and 100% duty cycles. a 0% duty waveform can be obtained by setting the counter clear source to grb and then setting gra to a larger value than grb. a 100% duty waveform can be obtained by setting the counter clear source to gra and then setting grb to a larger value than gra.
266 counter cleared by gra compare match tcnt value gra grb tioca time counter cleared by grb compare match tcnt value grb gra tioca time a. counter cleared by gra b. counter cleared by grb figure 10.29 pwm mode operation example 1
267 counter cleared on compare match b tcnt value grb tioca time gra write gra write a. 0% duty gra counter cleared on compare match a tcnt value gra grb tioca time grb write grb write b. 100% duty h'0000 h'0000 figure 10.30 pwm mode operation example 2
268 10.4.5 reset-synchronized pwm mode in reset-synchronized pwm mode, three pairs of complementary positive and negative pwm waveforms that share a common wave turning point can be obtained using channels 3 and 4. when set for reset-synchronized pwm mode, the tioca3, tiocb3, tioca4, tocxa4, tiocb4, and tocxb4 pins become pwm output pins and tcnt3 becomes an up-counter. table 10.12 shows the pwm output pins used and table 10.13 shows the settings of the registers used. table 10.12 output pins for reset-synchronized pwm mode channel output pin description 3 tioca3 pwm output 1 tiocb3 pwm output 1' (negative-phase waveform of pwm output 1) 4 tioca4 pwm output 2 tocxa4 pwm output 2' (negative-phase waveform of pwm output 2) tiocb4 pwm output 3 tocxb4 pwm output 3' (negative-phase waveform of pwm output 3) table 10.13 register settings for reset-synchronized pwm mode register setting tcnt3 initial setting of h'0000 tcnt4 not used (functions independently) gra3 sets count cycle for tcnt3 grb3 sets the turning point for pwm waveform output by the tioca3 and tiocb3 pins gra4 sets the turning point for pwm waveform output by the tioca4 and tocxa4 pins grb4 sets the turning point for pwm waveform output by the tiocb4 and tocxb4 pins procedure for selecting reset-synchronized pwm mode (figure 10.31): 1. clear the str3 bit in tstr to halt tcnt3. reset-synchronized pwm mode must be set while tcnt3 is halted. 2. set bits tpsc2-tpsc0 in tcr to select the counter clock source for channel 3. if an external clock source is selected, select the external clock edge with bits ckeg1 and ckeg0 in tcr. 3. set bits cclr1 and cclr0 in tcr3 to select gra3 as a counter clear source. 4. set bits cmd1 and cmd0 in tfcr to select reset-synchronized pwm mode. tioca3, tiocb3, tioca4, tiocb4, tocxa4, and tocxb4 become pwm output pins. 5. reset tcnt3 (to h'0000). tcnt4 need not be set.
269 6. gra3 is the waveform period register. set the waveform period value in gra3. set the transition times of the pwm output waveforms in grb3, gra4, and grb4. set times within the compare match range of tcnt3. x gra3 (x: set value) 7. set the str3 bit in tstr to 1 to start the tcnt3 count. (1) (2) (3) (4) (5) (6) stop counting select counter clock start counting select counter clear source reset synchronized pwm mode select reset-synchronized pwm mode set tcnt set general registers (7) reset-synchronized pwm mode figure 10.31 procedure for selecting reset-synchronized pwm mode
270 reset-synchronized pwm mode operation: figure 10.32 shows an example of operation in reset-synchronized pwm mode. tcnt3 operates as an up-counter that is cleared to h'0000 at compare match with gra3. tcnt4 runs independently and is isolated from gra4 and grb4. the pwm waveform outputs toggle at each compare match (grb3, gra3, and grb4 with tcnt3) and when the counter is cleared. see section 10.4.8, buffer mode, for details on simultaneously setting reset-synchronized pwm mode and buffer operation. gra3 grb3 grb4 gra4 tioca3 tiocb3 tioca4 tocxa4 tiocb4 tocxb4 counter cleared at gra3 compare match time tcnt value figure 10.32 reset-synchronized pwm mode operation example 1
271 10.4.6 complementary pwm mode in complementary pwm mode, three pairs of complementary, non-overlapping, positive and negative pwm waveforms can be obtained using channels 3 and 4. in complementary pwm mode, the tioca3, tiocb3, tioca4, tocxa4, tiocb4, and tocxb4 pins become pwm output pins and tcnt3 and tcnt4 become up-counters. table 10.14 shows the pwm output pins used and table 10.15 shows the settings of the registers used. table 10.14 output pins for complementary pwm mode channel output pin description 3 tioca3 pwm output 1 tiocb3 pwm output 1' (non-overlapping negative-phase waveform of pwm output 1) 4 tioca4 pwm output 2 tocxa4 pwm output 2' (non-overlapping negative-phase waveform of pwm output 2) tiocb4 pwm output 3 tocxb4 pwm output 3' (non-overlapping negative-phase waveform of pwm output 3) table 10.15 register settings for complementary pwm mode register setting tcnt3 initial setting of non-overlap cycle (difference with tcnt4) tcnt4 initial setting of h'0000 gra3 sets upper limit of tcnt3 1 grb3 sets the turning point for pwm waveform output by the tioca3 and tiocb3 pins gra4 sets the turning point for pwm waveform output by the tioca4 and tocxa4 pins grb4 sets the turning point for pwm waveform output by the tiocb4 and tocxb4 pins procedure for selecting complementary pwm mode (figure 10.33): 1. clear the str3 and str4 bits in tstr to halt the timer counters. complementary pwm mode must be set while tcnt3 and tcnt4 are halted. 2. set bits tpsc2?psc0 in tcr to select the same counter clock source for channels 3 and 4. if an external clock source is selected, select the external clock edge with bits ckeg1 and ckeg0 in tcr. do not select any counter clear source with bits cclr1 and cclr0 in tcr. 3. set bits cmd1 and cmd0 in tmdb to select complementary pwm mode. tioca3, tiocb3, tioca4, tiocb4, tocxa4, and tocxb4 become pwm pins.
272 4. reset tcnt4 (to h'0000). set the non-overlap offset in tcnt3. do not set tcnt3 and tcnt4 to the same value. 5. gra3 is the waveform period register. set the upper limit of tcnt3? * . set the transition times of the pwm output waveforms in grb3, gra4, and grb4. set times within the compare match range of tcnt3 and tcnt4. t x (x: initial setting of grb3, gra4, and grb4; t: initial setting of tcnt3) note: *gra3 = [cycle count/2] + [count of non-overlaps] - 2cyc=[upper limit of tcnt3]-1 6. set the str3 and str4 bits in tstr to 1 to start the tcnt3 and tcnt4 counts. (1) (2) (3) (4) (5) (6) set general registers start counting complementary pwm mode stop counting select counter clock set tcnt complementary pwm mode select complementary pwm mode note: to re-establish complementary pwm mode after it has been aborted, start settings from step 1. figure 10.33 procedure for selecting complementary pwm mode
273 complementary pwm mode operation: figure 10.34 shows an example of operation in complementary pwm mode. tcnt3 and tcnt4 operate as up/down-counters, counting down from compare match of tcnt3 and gra3 and counting up when tcnt4 underflows. pwm waveforms are output by repeated compare matches with grb3, gra4, and grb4 in the sequence tcnt3, tcnt4, tcnt4, tcnt3 (in this mode, tcnt3 starts out at a higher value than tcnt4). figure 10.35 shows examples of pwm waveforms with 0% and 100% duty cycles (in one phase) in complementary pwm mode. in this example, the pin output changes upon grb3 compare match, so duty cycles of 0% and 100% can be obtained by setting grb3 to a value larger than gra3. combining buffer operation with the above operation makes it easy to change the duty while operating. see section 10.4.8, buffer mode, for details. down-counting starts at compare match between tcnt3 and gra3 tcnt3 tcnt4 tcnt3, tcnt4 value gra3 grb3 gra4 grb4 tioca3 tiocb3 tioca4 tocxa4 tiocb4 tocxb4 up-counting starts at tcnt4 underflow time figure 10.34 complementary pwm mode operation example 1
274 tcnt3, tcnt4 value gra3 grb3 tioca3 tiocb3 time 0% duty (a) with 0% duty tioca3 tiocb3 gra3 grb3 tcnt3, tcnt4 value time 100% duty (b) with 100% duty figure 10.35 complementary pwm mode operation example 2 at the point where the up-count/down-count changes in complementary pwm mode, tcnt3 and tcnt4 will overshoot and undershoot, respectively. when this occurs, the setting conditions for the imfa bit of channel 3 and the overflow flag (ovf) of channel 4 are different from usual. transfer conditions for the buffer also differ. the timing is as shown in figures 10.36 and 10.37.
275 n 1n n + 1 nn 1 tcnt3 gra3 imfa buffer transfer signal (br to gr) gr set to 1 n buffer transfer performed flag not set buffer transfer not performed figure 10.36 overshoot timing gr buffer transfer signal (br to gr) tcnt4 h' 0001 h' 0000 h' ffff h' 0000 underflow flag not set set to 1 buffer transfer performed buffer transfer not performed ovf overflow figure 10.37 undershoot timing the imfa bit of channel 3 is set to 1 for increment pulses and the ovf bit of channel 4 is set to 1 for underflows only. the buffer register (br) set for the buffer operation is transferred to gr upon compare match a3 (when incrementing) or tcnt4 underflow.
276 gr setting in complementary pwm mode: note the following when setting the general registers in complementary pwm mode and when making changes during operation. ? initial values: settings from h'0000 to t? (t: tcnt3 initial setting) are prohibited. after counting starts, this setting is allowed from the point when the first a3 compare match occurs. ? methods of changing settings: use buffer operation. writing directly to general registers may result in incorrect waveform output. ? when changing settings: see figure 10.38. gra3 gr h' 0000 br gr prohibited figure 10.38 example of changing gr settings with buffer operation (1) buffer transfers when changing from increment to decrement: when the contents of gr are in the range gra3 ?t + 1 to gra3, do not transfer a value outside this range. when the contents of gr are outside this range, do not a transfer a value within it. figure 10.39 illustrates a point for caution regarding changing of gr settings with buffer operation. gra3 + 1 gra3 gra3 t + 1 gra3 t tcnt3 tcnt4 changes prohibited figure 10.39 caution on changing gr settings with buffer operation (1) buffer transfers when changing from decrement to increment: when the contents of gr are in the range h'0000 to t?, do not transfer a value outside this range. when the contents of gr are outside this range, do not transfer a value within it. figure 10.40 illustrates this point for caution regarding changing of gr settings with buffer operation
277 tcnt4 t t 1 h' 0000 h' ffff tcnt3 changes prohibited figure 10.40 caution on changing gr settings with buffer operation (2) when gr settings are outside the count range (h'0000?ra3): waveforms with a duty cycle of 0% and 100% can be output by setting gr outside the count area. be sure to make the direction of the count (increment/decrement) when writing a setting from outside the count area into the buffer register (br) the same as the count direction when writing the setting that returns to within the count area in br. gra3 gr h' 0000 output pin output pin br gr 0% duty 100% duty write on decrement write on increment figure 10.41 example of changing gr settings with buffer operation (2) the above settings are made by detecting the occurrence of a gra3 compare match or underflow of tcnt4 and then writing to br. they can also be accomplished by starting the dmac with a gra3 compare match.
278 10.4.7 phase counting mode phase counting mode detects the phase differential of two external clock inputs (tclka and tclkb) and increments or decrements tcnt2. when phase counting mode is set, the tclka and tclkb pins become external clock input pins, regardless of the settings of the tpsc2 tpsc0 bits in tcr2 or the ckeg1 and ckeg0 bits. tcnt2 also becomes an up/down-counter. since the tcr2 cclr1/cclr0 bits, tior2, tier2, tsr2, gra2, and grb2 are all enabled, input capture and compare match functions and interrupt sources can be used. phase counting is available only for channel 2. procedure for selecting phase counting mode: figure 10.42 shows the procedure for selecting phase counting mode. 1. set the mdf bit in the timer mode register (tmdr) to 1 to select phase counting mode. 2. select the flag set conditions using the fdir bit in tmdr. 3. set the str2 bit in the timer start register (tstr) to 1 to start the count. (1) (2) (3) phase counting mode start counting phase counting mode select phase counting mode select flag setting condition figure 10.42 procedure for selecting phase counting mode phase counting operation: figure 10.43 shows an example of phase counting mode operation. table 10.16 lists the up-counting and down-counting conditions for tcnt2. the itu counts on both rising and falling edges of tclka and tclkb. the phase differential and overlap of tclka and tclkb must be 1.5 cycles or more and the pulse width must be 2.5 cycles or more.
279 tcnt2 value increment decrement tclkb tclka tcnt2 time figure 10.43 phase counting mode operation table 10.16 up/down-counting conditions counting direction increment decrement tclkb rising high falling low rising high falling low tclka low rising high falling high falling low rising tclka tclkb phase differential phase differential, overlap: 1.5 cycles minimum pulse width: 2.5 cycles minimum phase differential pulse width pulse width overlap overlap figure 10.44 phase differentials, overlap, and pulse width in phase counting mode
280 10.4.8 buffer mode in buffer mode, the buffer operation functions differ depending on whether the general registers are set to output compare or input capture, reset-synchronized pwm mode, or complementary pwm mode. buffer mode is a function of channels 3 and 4 only. buffer operations set this way function as follows. gr is an output compare register: the value of the buffer register of a channel is transferred to gr when a compare match occurs in the channel. this is illustrated in figure 10.45. br gr comparator tcnt compare match signal figure 10.45 compare match buffer operation gr is an input capture register: tcnt values are transferred to gr when input capture occurs and the value previously stored in gr is transferred to br. this operation is illustrated in figure 10.46. input capture signal br gr tcnt figure 10.46 input capture buffer operation complementary pwm mode: when the count direction of tcnt3 and tcnt4 changes, the br value is transferred to gr. the following timing is employed for this transfer: ? when there is a tcnt3/gra3 compare-match ? when there is a tcnt4 underflows
281 reset-synchronized pwm mode: the br value is transferred to gr upon a gra3 compare match. procedure for selecting buffer mode (figure 10.47): 1. set tior to select the output compare or input capture function of gr. 2. set bits bfa3, bfb3 and bfb4 in tfcr to select buffer mode for gr. 3. set the str bit in tstr to 1 to start the tcnt count. (1) (2) (3) select general register function buffer mode select buffer mode start counting buffer mode figure 10.47 procedure for selecting buffer mode buffer mode operation: figure 10.48 shows an example of an operation in buffer mode with gra set as an output compare register and gra and buffer register a (bra) set for buffer operation. tcnt operates as a periodic counter that is cleared by a grb compare match. tioca and tiocb are set to toggle at compare matches a and b. since buffer mode is selected, when tioca toggles at compare match a, the bra value is simultaneously transferred to gra. this operation is repeated at every compare match a. the transfer timing is shown in figure 10.49.
282 grb h' 0250 h' 0200 h' 0100 h' 0000 bra gra tiocb tioca h' 0200 h' 0100 h' 0200 h' 0250 h' 0200 h' 0200 tcnt value counter cleared by compare match b time toggle output toggle output compare match a h' 0100 figure 10.48 buffer mode operation example 1 (output compare register) ck tcnt compare match signal buffer transfer signal br gr n n + 1 n n n figure 10.49 compare match timing example for buffer operation figure 10.50 shows an example of input capture operation in buffer mode between gra and bra with gra as an input capture register. tcnt is cleared by input capture b. the falling edge is selected as the input capture edge at tiocb. both edges are selected as input capture edges at tioca. when the tcnt value is stored in gra by input capture a, the previous gra value is transferred to bra. the timing is shown in figure 10.51.
283 tcnt value h' 0180 h' 0160 h' 0005 tiocb tioca gra bra grb counter cleared at input capture b time h' 0005 h' 0160 h' 0005 h' 0160 h' 0180 input capture a figure 10.50 buffer mode operation example 2 (input capture register) ck tioc pin input capture signal tcnt br gr n n + 1 n n + 1 m m nnn mmn figure 10.51 input capture timing example for buffer operation
284 an example of buffer operation in complementary pwm mode between grb3 and brb3 is shown in figure 10.52. by making grb3 larger than gra3 using buffer operation, a pwm waveform with a duty cycle of 0% is generated. the transfer from brb to grb occurs upon tcnt3 and gra compare match and tcnt4 underflow. tcnt3 and tcnt4 values h' 1fff gra3 h' 0999 h' 0000 brb3 grb3 tioca3 tiocb3 h' 1fff h' 1fff time h' 0999 h' 0999 h' 1fff h' 0999 tcnt3 tcnt4 grb3 h' 0999 h' 0999 figure 10.52 buffer mode operation example 3 (complementary pwm mode)
285 10.4.9 itu output timing itu outputs in channels 3 and 4 can be inverted with tocr. output inversion timing with tocr: output levels can be inverted by inverting the output level select bits (ols4 and ols3) in tocr in complementary pwm mode and reset- synchronized pwm mode. figure 10.53 illustrates the timing. t1 t3 t2 ck address tocr inversion tocr address itu output pin figure 10.53 example of inverting itu output levels by writing to tocr
286 10.5 interrupts the itu has two interrupt sources: input capture/compare match and overflow. 10.5.1 timing of setting status flags timing for setting imfa and imfb in a compare match: the imf bits in tsr are set to 1 by a compare match signal generated when tcnt matches a general register. the compare match signal is generated in the last state in which the values match (when tcnt is updated from the matching count to the next count). therefore, when tcnt matches gra or grb, the compare match signal is not generated until the next timer clock input. figure 10.54 shows the timing of setting the imf bits. ck tcnt input clock tcnt gr compare match signal imf imi n n n + 1 figure 10.54 timing of setting compare match flags (imfa, imfb)
287 timing of setting imfa, imfb for input capture: imfa and imfb are set to 1 by an input capture signal. at this time, the tcnt contents are transferred to gr. figure 10.55 shows the timing. ck input capture signal tcnt gr imf imi n n figure 10.55 timing of setting imfa and imfb for input capture timing of setting overflow flag (ovf): ovf is set to 1 when tcnt overflows from h'ffff to h'0000 or underflows from h'0000 to h'ffff. figure 10.56 shows the timing.
288 h' ffff h' 0000 ck tcnt overflow signal ovf ovi figure 10.56 timing of setting ovf 10.5.2 status flag clear timing the status flags are cleared by being read by the cpu when set to 1, then being written with 0. this timing is shown in figure 10.57. t1 t3 t2 ck address imf, ovf tsr address tsr write cycle figure 10.57 timing of status flag clearing
289 10.5.3 interrupt sources and dmac activation the itu has compare match/input capture a interrupts, compare match/input capture b interrupts and overflow interrupts for each channel. each of the fifteen of these three types of interrupts are allocated their own independently vectored addresses. when the interrupt's interrupt request flag is set to 1 and the interrupt enable bit is set to 1, the interrupt is requested. the channel priority order can be changed with the interrupt controller. for more information, see section 5, interrupt controller (intc). the compare match/input capture a interrupts of channels 0? can start the dmac to transfer data. table 10.17 lists the interrupt sources. table 10.17 itu interrupt sources channel interrupt source description dmac activation priority order * 0 imia0 compare match or input capture a0 yes high imib0 compare match or input capture b0 no ovi0 overflow 0 no 1 imia1 compare match or input capture a1 yes imib1 compare match or input capture b1 no ovi1 overflow 1 no 2 imia2 compare match or input capture a2 yes imib2 compare match or input capture b2 no ovi2 overflow 2 no 3 imia3 compare match or input capture a3 yes imib3 compare match or input capture b3 no ovi3 overflow 3 no 4 imia4 compare match or input capture a4 no imib4 compare match or input capture b4 no ovi4 overflow 4 no low note: * indicates the initial status following a reset. the ranking of channels can be altered using the interrupt controller.
290 10.6 notes and precautions this section describes contention and other matters requiring special attention during itu operation. 10.6.1 contention between tcnt write and clear if a counter clear signal occurs in the t3 state of a tcnt write cycle, clearing the counter takes priority and the write is not performed. the timing is shown in figure 10.58. t1 t3 t2 ck address internal write signal counter clear signal tcnt tcnt write cycle by cpu tcnt address n h' 0000 figure 10.58 contention between tcnt write and clear
291 10.6.2 contention between tcnt word write and increment if an increment pulse occurs in the t3 state of a tcnt word write cycle, writing takes priority and tcnt is not incremented. the timing is shown in figure 10.59. t1 t3 t2 ck address internal write signal tcnt input clock tcnt tcnt word write cycle by cpu tcnt address n m tcnt write data figure 10.59 contention between tcnt word write and increment
292 10.6.3 contention between tcnt byte write and increment if an increment pulse occurs in the t2 state or t3 state of a tcnt byte write cycle, counter writing takes priority and the byte data on the side that was previously written is not incremented. the tcnt byte data that was not written is also not incremented and retains its previous value. the timing is shown in figure 10.60 (which shows an increment during state t2 of a byte write cycle to tcnth). t1 t3 t2 ck address internal write signal tcnt input clock tcnth tcnth byte write cycle by cpu tcnth address n m tcnt write data x x + 1 x tcntl figure 10.60 contention between tcnt byte write and increment
293 10.6.4 contention between gr write and compare match if a compare match occurs in the t3 state of a general register (gr) write cycle, writing takes priority and the compare match signal is inhibited. the timing is shown in figure 10.61. t1 t2 t3 gr write cycle gr address n n + 1 nm gr write data inhibited ck address internal write signal tcnt gr compare match signal figure 10.61 contention between general register write and compare match
294 10.6.5 contention between tcnt write and overflow/underflow if an overflow occurs in the t3 state of a tcnt write cycle, writing takes priority over counter incrementing. ovf is set to 1. the same applies to underflows. the timing is shown in figure 10.62. t1 t2 t3 tcnt write cycle tcnt address h'ffff m tcnt write data ck address internal write signal tcnt input clock overflow signal tcnt ovf figure 10.62 contention between tcnt write and overflow
295 10.6.6 contention between general register read and input capture if an input capture signal is generated during the t3 state of a general register read cycle, the value before input capture is read. the timing is shown in figure 10.63. t1 t2 t3 gr read cycle gr address xm ck address internal read signal input capture signal gr internal data bus x figure 10.63 contention between general register read and input capture
296 10.6.7 contention between counter clearing by input capture and counter increment if an input capture signal and counter increment signal occur simultaneously, the counter is cleared by the input capture signal. the counter is not incremented by the increment signal. the tcnt value before the counter is cleared is transferred to the general register. the timing is shown in figure 10.64. n h'0000 ck input capture signal counter clear signal tcnt input clock tcnt gr n figure 10.64 contention between counter clearing by input capture and counter increment
297 10.6.8 contention between general register write and input capture if an input capture signal is generated during the t3 state of a general register write cycle, the input capture transfer takes priority and the write to gr is not performed. the timing is shown in figure 10.65. t1 t2 t3 gr write cycle gr address m ck address internal write signal input capture signal tcnt gr m figure 10.65 contention between general register write and input capture 10.6.9 note on waveform cycle setting when a counter is cleared by compare match, the counter is cleared in the last state in which the tcnt value matches the gr value (when tcnt is updated from the matching count to the next count). the actual counter frequency is therefore given by the following formula: f = /(n + 1) (f: counter frequency; : operating frequency; n: value set in gr)
298 10.6.10 contention between br write and input capture when a buffer register (br) is being used as an input capture register and an input capture signal is generated in the t3 state of the write cycle, the buffer operation takes priority over the br write. the timing is shown in figure 10.66. t1 t2 t3 br write cycle br address nx ck address internal write signal input capture signal gr br mn tcnt value figure 10.66 contention between br write and input capture
299 10.6.11 note on writing in synchronizing mode after synchronizing mode is selected, if tcnt is written by byte access, all 16 bits of all synchronized counters assume the same value as the counter that was addressed. example: figures 10.67 and 10.68 show byte write and word write when channels 2 and 3 are synchronized ax tcnt2 ax tcnt3 ya tcnt2 ya tcnt3 write a to lower byte of channel 3 write a to upper byte of channel 2 wx tcnt2 yz tcnt3 upper byte lower byte upper byte lower byte upper byte lower byte figure 10.67 byte write to channel 2 or byte write to channel 3 ab tcnt2 ab tcnt3 word write of ab for channel 2 or 3 wx tcnt2 yz tcnt3 upper byte lower byte upper byte lower byte figure 10.68 word write to channel 2 or word write to channel 3 10.6.12 note on setting reset-synchronized pwm mode/complementary pwm mode when the cmd1 and cmd0 bits in tfcr are set, note the following. 1. writes to cmd1 and cmd0 should be carried out while tcnt3 and tcnt4 are halted. 2. changes of setting from reset-synchronized pwm mode to complementary pwm mode and vice versa are prohibited. set reset-synchronized pwm mode or complementary pwm mode after first setting normal operation (clear cmd1 bit to 0).
300 10.6.13 clearing complementary pwm mode figure 10.69 shows the procedure for clearing complementary pwm mode. first, reset combination mode bits cmd1 and cmd0 in the timer function control register (tfcr) from 10 to either 00 or 01. the mode will switch from complementary pwm mode to normal operating mode. next, wait for at least 1 cycle of the counter input clock being used for channels 3 and 4 and then clear counter start bits str3 and str4 in the timer start register (tstr). the channel 3 and 4 counters, tcnt3 and tcnt4, will stop counting. clearing complementary pwm mode by any other procedure may result in changes other than those set for the output waveform when complementary pwm mode is set again. complementary pwm mode normal operation 1. 2. clear the cmd1 bit in tfcr to 0 to set channels 3 and 4 for normal operation wait at least 1 clock cycle after setting channels 3 and 4 for normal operation and then clear the str3 and str4 bits in tstr to 0 to halt the tcnt3 and tcnt4 counters clear complementary pwm mode halt count figure 10.69 clearing complementary pwm mode 10.6.14 note on counter clearing by input capture if tcnt is cleared (to h'0000) by input capture when its value is h'ffff, overflow will not occur.
301 10.6.15 itu operating modes table 10.18 itu operating modes (channel 0) register setting tsnc tmdr tfcr tocr tior0 tcr0 operating mode sync mdf fdir pwm comp pwm reset sync pwm buffer output level select ioa iob clear select clock select synch- ronized preset sync0 = 1 ? ? pwm pwm0 = 1 * ? output compare a function pwm0 = 0 ioa2 = 0, others: don t care ?? output compare b function iob2 = 0, others: don t care ? input capture a function pwm0 = 0 ioa2 = 1, others: don t care ?? input capture b function pwm0 = 0 iob2 = 1, others: don t care ? counter clear function clear at compare match/ input capture a ? cclr1 = 0 cclr0 = 1 clear at compare match/ input capture b ? cclr1 = 1 cclr0 = 0 synch- ronized clear sync0 = 1 ? cclr1 = 1 cclr0 = 1 : settable, : setting does not affect current mode note: * in pwm mode, the input capture function cannot be used. when compare match a and compare match b occur simultaneously, the compare match signal is inhibited.
302 table 10.19 itu operating modes (channel 1) register setting tsnc tmdr tfcr tocr tior1 tcr1 operating mode sync mdf fdir pwm comp pwm reset sync pwm buffer output level select ioa iob clear select clock select synch- ronized preset sync1 = 1 ? ? pwm pwm1 = 1 * ? output compare a function pwm1 = 0 ioa2 = 0, others: don t care ?? output compare b function iob2 = 0, others: don t care ? input capture a function pwm1 = 0 ioa2 = 1, others: don t care ?? input capture b function pwm1 = 0 iob2 = 1, others: don t care ? counter clear function clear at compare match/ input capture a ? cclr1 = 0 cclr0 = 1 clear at compare match/ input capture b ? cclr1 = 1 cclr0 = 0 synch- ronized clear sync1 = 1 ? cclr1 = 1 cclr0 = 1 : settable, : setting does not affect current mode note: * in pwm mode, the input capture function cannot be used. when compare match a and compare match b occur simultaneously, the compare match signal is inhibited.
303 table 10.20 itu operating modes (channel 2) register setting tsnc tmdr tfcr tocr tior2 tcr2 operating mode sync mdf fdir pwm comp pwm reset sync pwm buffer output level select ioa iob clear select clock select synch- ronized preset sync2 = 1 ? ? pwm pwm2 = 1 * ? output compare a function pwm2 = 0 ioa2 = 0, others: don t care ?? output compare b function iob2 = 0, others: don t care ? input capture a function pwm2 = 0 ioa2 = 1, others: don t care ?? input capture b function pwm2 = 0 iob2 = 1, others: don t care ? counter clear function clear at compare match/ input capture a ? cclr1 = 0 cclr0 = 1 clear at compare match/ input capture b ? cclr1 = 1 cclr0 = 0 synch- ronized clear sync2 = 1 ? cclr1 = 1 cclr0 = 1 phase counting mdf = 1 ? ? : settable, : setting does not affect current mode note: * in pwm mode, the input capture function cannot be used. when compare match a and compare match b occur simultaneously, the compare match signal is inhibited.
304 table 10.21 itu operating modes (channel 3) register setting tsnc tmdr tfcr tocr tior3 tcr3 operating mode sync mdf fdir pwm comp pwm reset sync pwm buffer output level select ioa iob clear select clock select synch- ronized preset sync3 = 1 ? * 2 ? ? ? pwm mode pwm3 = 1 cmd1 = 0 cmd1 = 0 * 1 ? output compare a function pwm3 = 0 cmd1 = 0 cmd1 = 0 ioa2 = 0, others: don t care ?? output compare b function cmd1 = 0 cmd1 = 0 iob2 = 0, others: don t care ? input capture a function pwm3 = 0 cmd1 = 0 cmd1 = 0 ioa2 = 1, others: don t care ?? input capture b function pwm3 = 0 cmd1 = 0 cmd1 = 0 iob2 = 1, others: don t care ? counter clear function clear at compare match/ input capture a cmd1 = 1, cmd0 = 0 inhib- ited * 3 ? cclr1 = 0 cclr0 = 1 clear at compare match/ input capture b cmd1 = 0 cmd1 = 0 ? cclr1 = 1 cclr0 = 0 synch- ronized clear sync3 = 1 cmd1 = 1, cmd0 = 0 inhib- ited ? ? cclr1 = 1 cclr0 = 1
305 table 10.21 itu operating modes (channel 3) (cont) register setting tsnc tmdr tfcr tocr tior3 tcr3 operating mode sync mdf fdir pwm comp pwm reset sync pwm buffer output level select ioa iob clear select clock select comple- mentary pwm mode * 2 cmd1 = 1 cmd0 = 0 cmd1 = 1 cmd0 = 0 ? cclr1 = 0 cclr0 = 0 * 4 reset synchron- ized pwm mode cmd1 = 1 cmd0 = 1 cmd1 = 1 cmd0 = 1 ? cclr1 = 0 cclr0 = 1 buffer (bra) ?? bfa3 = 1, others: don t care ? ? buffer (brb) ?? bfb3 = 1, others: don t care ? ? : settable, : setting does not affect current mode notes: * 1 in pwm mode, the input capture function cannot be used. when compare match a and compare match b occur simultaneously, the compare match signal is inhibited. * 2 when set for complementary pwm mode, do not simultaneously set channel 3 and channel 4 to function synchronously. * 3 counter clearing by input capture a cannot be used when reset-synchronized pwm mode is set. * 4 clock selection when complementary pwm mode is set should be the same for channels 3 and 4.
306 table 10.22 itu operating modes (channel 4) register setting tsnc tmdr tfcr tocr tior4 tcr4 operating mode sync mdf fdir pwm comp pwm reset sync pwm buffer output level select ioa iob clear select clock select synch- ronized preset sync4 = 1 ? * 2 ? ? ? pwm pwm4 = 1 cmd1 = 0 cmd1 = 0 * 1 ? output compare a function pwm4 = 0 cmd1 = 0 cmd1 = 0 ioa2 = 0, others: don t care ?? output compare b function cmd1 = 0 cmd1 = 0 iob2 = 0, others: don t care ? input capture a function pwm4 = 0 cmd1 = 0 cmd1 = 0 ioa2 = 1, others: don t care ?? input capture b function pwm4 = 0 cmd1 = 0 cmd1 = 0 iob2 = 1, others: don t care ? counter clear function clear at compare match/ input capture a cmd1 = 1, cmd0 = 0 inhib- ited * 3 ? cclr1 = 0 cclr0 = 1 clear at compare match/ input capture b cmd1 = 1, cmd0 = 0 inhib- ited * 3 ? cclr1 = 1 cclr0 = 0 synch- ronized clear sync4 = 1 cmd1 = 1, cmd1 = 0 inhib- ited * 3 ? cclr1 = 1 cclr0 = 1
307 table 10.22 itu operating modes (channel 4) (cont) register setting tsnc tmdr tfcr tocr tior4 tcr4 operating mode sync mdf fdir pwm comp pwm reset sync pwm buffer output level select ioa iob clear select clock select comple- mentary pwm * 2 cmd1 = 1 cmd0 = 0 cmd1 = 1 cmd0 = 0 ? cclr1 = 0 cclr0 = 0 * 4 reset synchron- ized pwm cmd1 = 1 cmd0 = 1 cmd1 = 1 cmd0 = 1 ? * 5 * 5 buffer (bra) ?? bfa4 = 1, others: don t care ? ? buffer (brb) ?? bfb4 = 1, others: don t care ? ? : settable, : setting does not affect current mode notes: * 1 in pwm mode, the input capture function cannot be used. when compare match a and compare match b occur simultaneously, the compare match signal is inhibited. * 2 when set for complementary pwm mode, do not simultaneously set channel 3 and channel 4 to function synchronously. * 3 counter clearing works with reset-synchronized pwm mode, but tcnt4 runs independently. the output waveform is not affected. * 4 clock selection when complementary pwm mode is set should be the same for channels 3 and 4. * 5 in reset-synchronized pwm mode, tcnt4 runs independently. the output waveform is not affected.
308
309 section 11 programmable timing pattern controller (tpc) 11.1 overview the superh microcomputer has an on-chip programmable timing pattern controller (tpc). the tpc can provide pulse outputs by using the 16-bit integrated timer pulse unit (itu) as a time base. the tpc pulse outputs are divided into 4-bit groups 3?. these can operate simultaneously or independently. 11.1.1 features features of the programmable timing pattern controller are listed below: ? 16-bit output data: maximum 16-bit data can be output. tpc output can be enabled on a bit- by-bit basis. ? four output groups: output trigger signals can be selected in 4-bit groups to provide up to four different 4-bit outputs. ? selectable output trigger signals: output trigger signals can be selected by group from the 4-channel compare-match signals of the 16-bit integrated timer pulse unit (itu). ? non-overlap mode: a non-overlap interval can be set to come between multiple pulse outputs. ? can connect to dma controller: the compare-match signals selected as output trigger signals can activate the dma controller for sequential output of data without cpu intervention.
310 11.1.2 block diagram figure 11.1 shows a block diagram of the tpc. pbcr1 ndera tpmr pbcr2 nderb tpcr pbdr control logic pulse output pin group 3 pulse output pin group 2 pulse output pin group 1 pulse output pin group 0 itu compare match signal tp15 tp14 tp13 tp12 tp11 tp10 tp9 tp8 tp7 tp6 tp5 tp4 tp3 tp2 tp1 tp0 internal data bus ndrb ndra tpc tpmr: tpc output mode register pbcr1: port b control register 1 tpcr: tpc output control register pbcr2: port b control register 2 nderb: next data enable register b ndrb: next data register b ndera: next data enable register a ndra: next data register a pbdr: port b data register figure 11.1 block diagram of tpc
311 11.1.3 input/output pins table 11.1 summarizes the tpc input/output pins. table 11.1 tpc pins name symbol input/output function tpc output 0 tp0 output group 0 pulse output tpc output 1 tp1 output tpc output 2 tp2 output tpc output 3 tp3 output tpc output 4 tp4 output group 1 pulse output tpc output 5 tp5 output tpc output 6 tp6 output tpc output 7 tp7 output tpc output 8 tp8 output group 2 pulse output tpc output 9 tp9 output tpc output 10 tp10 output tpc output 11 tp11 output tpc output 12 tp12 output group 3 pulse output tpc output 13 tp13 output tpc output 14 tp14 output tpc output 15 tp15 output
312 11.1.4 registers table 11.2 summarizes the tpc registers. table 11.2 tpc registers name abbreviation r/w initial value address * 1 access size port b control register 1 pbcr1 r/w h'0000 h'5ffffcc 8, 16 port b control register 2 pbcr2 r/w h'0000 h'5ffffce 8, 16 port b data register pbdr r/(w) * 2 h'0000 h'5ffffc2 8, 16 tpc output mode register tpmr r/w h'f0 h'5fffff0 8, 16 tpc output control register tpcr r/w h'ff h'5fffff1 8, 16 next data enable register b nderb r/w h'00 h'5fffff2 8, 16 next data enable register a ndera r/w h'00 h'5fffff3 8, 16 next data register a ndra r/w h'00 h'5fffff5/ h'5fffff7 * 3 8, 16 next data register b ndrb r/w h'00 h'5fffff4/ h'5fffff6 * 3 8, 16 notes: * 1 only the values of bits a27?24 and a8?0 are valid; bits a23?9 are ignored. for details on the register addresses, see section 8.3.5, area descriptions. * 2 bits used for tpc output cannot be written to. * 3 these addresses change depending on the tpcr settings. when tpc output groups 0 and 1 have the same output trigger, the ndra address is h'5fffff5; when their output triggers are different, the ndra address for group 0 is h'5fffff7 and the address for group 1 is h'5fffff5. likewise, when tpc output groups 2 and 3 have the same output trigger, the ndrb address is h'5fffff4; when their output triggers are different, the ndrb address for group 0 is h'5fffff6 and the address for group 1 is h'5fffff4.
313 11.2 register descriptions 11.2.1 port b control registers 1 and 2 (pbcr1, pcbr2) port b control registers 1 and 2 (pbcr1 and pbcr2) are 16-bit read/write registers that set the functions of port b pins. port b consists of the dual-use pins tp15?p0. bits corresponding to the pins to be used for tpc output must be set to 11. for details, see the port b description in section 15, pin function controller (pfc). pcbr1: bit: 15 14 13 12 11 10 9 8 bit name: pb15 md1 pb15 md0 pb14 md1 pb14 md0 pb13 md1 pb13 md0 pb12 md1 pb12 md0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: pb11 md1 pb11 md0 pb10 md1 pb10 md0 pb9 md1 pb9 md0 pb8 md1 pb8 md0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w pcbr2: bit: 15 14 13 12 11 10 9 8 bit name: pb7md1 pb7md0 pb6md1 pb6md0 pb5md1 pb5md0 pb4md1 pb4md0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: pb3md1 pb3md0 pb2md1 pb2md0 pb1md1 pb1md0 pb0md1 pb0md0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w
314 11.2.2 port b data register (pbdr) the port b data register (pbdr) is a 16-bit read/write register that stores output data for groups 0 3 when tpc output is used. for details of pbdr, see section 16, i/o ports. bit: 15 14 13 12 11 10 9 8 bit name: pb15dr pb14dr pb13dr pb12dr pb11dr pb10dr pb9dr pb8dr initial value: 0 0 0 0 0 0 0 0 r/w: r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * note: * bits set to tpc output by ndera or nderb are read-only. bit: 7 6 5 4 3 2 1 0 bit name: pb7dr pb6dr pb5dr pb4dr pb3dr pb2dr pb1dr pb0dr initial value: 0 0 0 0 0 0 0 0 r/w: r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * note: * bits set to tpc output by ndera or nderb are read-only. 11.2.3 next data register a (ndra) ndra is an eight-bit read/write register that stores the next output data for tpc output groups 1 and 0 (tp7?p0). when used for tpc output, the contents of ndra are transferred to the corresponding pbdr bits when the itu compare match specified in the tpc output control register, tpcr, occurs. the address of ndra differs depending on whether tpcr settings select the same trigger or different triggers for tpc output groups 1 and 0. ndra is initialized to h'00 by a reset. it is not initialized in standby mode. same trigger for tpc output groups 1 and 0: if tpc output groups 1 and 0 are triggered by the same compare match, the address of ndra is h'fffff5. the upper 4 bits become group 1 and the lower 4 bits become group 0. address h'5fffff7 in such cases consists entirely of reserved bits. these bits cannot be modified and are always read as 1. address h'5fffff5: ? bits 7? (next data 7? (ndr7?dr4)): ndr7?dr4 store the next output data for tpc output group 1. ? bits 3? (next data 3? (ndr3?dr0)): ndr3?dr0 store the next output data for tpc output group 0.
315 bit: 7 6 5 4 3 2 1 0 bit name: ndr7 ndr6 ndr5 ndr4 ndr3 ndr2 ndr1 ndr0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w address h'5fffff7: ? bits 7? (reserved): these bits are always read as 1. the write value should always be 1. bit: 7 6 5 4 3 2 1 0 bit name: initial value: 1 1 1 1 1 1 1 1 r/w: different triggers for tpc output groups 1 and 0: if tpc output groups 1 and 0 are triggered by different compare matches, the address of the upper 4 bits of ndra (group 1) is h'5fffff5 and the address of the lower 4 bits of ndra (group 0) is h'5fffff7. bits 3? of address h'5fffff5 and bits 7? of address h'5fffff7 are reserved bits. the write value should always be 1. these bits are always read as 1. address h'5fffff5: ? bits 7? (next data 7? (ndr7?dr4)): ndr7?dr4 store the next output data for tpc output group 1. ? bits 3? (reserved): these bits are always read as 1. the write value should always be 1. bit: 7 6 5 4 3 2 1 0 bit name: ndr7 ndr6 ndr5 ndr4 initial value: 0 0 0 0 1 1 1 1 r/w: r/w r/w r/w r/w address h'5fffff7: ? bits 7? (reserved): these bits are always read as 1. the write value should always be 1. ? bits 3? (next data 3? (ndr3?dr0)): ndr3?dr0 store the next output data for tpc output group 0.
316 bit: 7 6 5 4 3 2 1 0 bit name: ndr3 ndr2 ndr1 ndr0 initial value: 1 1 1 1 0 0 0 0 r/w: r/w r/w r/w r/w 11.2.4 next data register b (ndrb) ndrb is an eight-bit read/write register that stores the next output data for tpc output groups 3 and 2 (tp15?p8). when used for tpc output, the contents of ndrb are transferred to the corresponding pbdr bits when the itu compare match specified in the tpc output control register, tpcr, occurs. the address of ndrb differs depending on whether tpcr settings select the same trigger or different triggers for tpc output groups 3 and 2. ndrb is initialized to h'00 by a reset. it is not initialized in standby mode. same trigger for tpc output groups 3 and 2: if tpc output groups 3 and 2 are triggered by the same compare match, the address of ndrb is h'fffff4. the upper 4 bits become group 3 and the lower 4 bits become group 2. address h'5fffff6 consists entirely of reserved bits. these bits are always read as 1, and the write value should always be 1. address h'5fffff4: ? bits 7? (next data 15?2 (ndr15?dr12)): ndr15?dr12 store the next output data for tpc output group 3. ? bits 3? (next data 11? (ndr11?dr8)): ndr11?dr8 store the next output data for tpc output group 2. bit: 7 6 5 4 3 2 1 0 bit name: ndr15 ndr14 ndr13 ndr12 ndr11 ndr10 ndr9 ndr8 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w address h'5fffff6: ? bits 7? (reserved): these bits are always read as 1. the write value should always be 1.
317 bit: 7 6 5 4 3 2 1 0 bit name: initial value: 1 1 1 1 1 1 1 1 r/w: different triggers for tpc output groups 3 and 2: if tpc output groups 3 and 2 are triggered by different compare matches, the address of the upper 4 bits of ndrb (group 3) is h'5fffff4 and the address of the lower 4 bits of ndrb (group 2) is h'5fffff6. bits 3? of address h'5fffff4 and bits 7? of address h'5fffff6 are reserved bits. these bits are always read as 1. the write value should always be 1. address h'5fffff4: ? bits 7? (next data 15?2 (ndr15?dr12)): ndr15?dr12 store the next output data for tpc output group 3. ? bits 3? (reserved): these bits are always read as 1. the write value should always be 1. bit: 7 6 5 4 3 2 1 0 bit name: ndr15 ndr14 ndr13 ndr12 initial value: 0 0 0 0 1 1 1 1 r/w: r/w r/w r/w r/w address h'5fffff6: ? bits 7? (reserved): these bits are always read as 1. the write value should always be 1. ? bits 3? (next data 11? (ndr11?dr8)): ndr11?dr8 store the next output data for tpc output group 2. bit: 7 6 5 4 3 2 1 0 bit name: ndr11 ndr10 ndr9 ndr8 initial value: 1 1 1 1 0 0 0 0 r/w: r/w r/w r/w r/w
318 11.2.5 next data enable register a (ndera) ndera is an eight-bit read/write register that enables tpc output groups 1 and 0 (tp7?p0) on a bit-by-bit basis. when the bits enabled for tpc output by ndera generate the itu compare match selected in the tpc output control register, the value of the next data register a (ndra) is automatically transferred to the corresponding pbdr bits and the output value is updated. for disabled bits, there is no transfer and the output value does not change. ndera is initialized to h'00 by a reset. it is not initialized in standby mode. bit: 7 6 5 4 3 2 1 0 bit name: nder7 nder6 nder5 nder4 nder3 nder2 nder1 nder0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w ? bits 7? (next data enable 7? (nder7?der0)): nder7?der0 select enabling/disabling for tpc output groups 1 and 0 (tp7?p0) in bit units. bit 7?: nder7?der0 description 0 disables tpc outputs tp7?p0 (transfer from ndr7?dr0 to pb7 pb0 is disabled) (initial value) 1 enables tpc outputs tp7?p0 (transfer from ndr7?dr0 to pb7 pb0 is enabled) 11.2.6 next data enable register b (nderb) nderb is an eight-bit read/write register that enables tpc output groups 3 and 2 (tp15?p8) on a bit-by-bit basis. when the bits enabled for tpc output by nderb generate the itu compare match selected in the tpc output control register, the value of the next data register b (ndrb) is automatically transferred to the corresponding pbdr bits and the output value is updated. for disabled bits, there is no transfer and the output value does not change. nderb is initialized to h'00 by a reset. it is not initialized in standby mode. bit: 7 6 5 4 3 2 1 0 bit name: nder15 nder14 nder13 nder12 nder11 nder10 nder9 nder8 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w
319 ? bits 7? (next data enable 15? (nder15?der8)): nder15?der8 select enabling/disabling for tpc output groups 3 and 2 (tp15?p8) in bit units. bit 7?: nder15?der8 description 0 disables tpc outputs tp15?p8 (transfer from ndr15?dr8 to pb15?b8 is disabled) (initial value) 1 enables tpc outputs tp15?p8 (transfer from ndr15?dr8 to pb15?b8 is enabled) 11.2.7 tpc output control register (tpcr) tpcr is an eight-bit read/write register that selects output trigger signals for tpc outputs. tpcr is initialized to h'ff by a reset. it is not initialized in standby mode. bit: 7 6 5 4 3 2 1 0 bit name: g3cms1 g3cms0 g2cms1 g2cms0 g1cms1 g1cms0 g0cms1 g0cms0 initial value: 1 1 1 1 1 1 1 1 r/w: r/w r/w r/w r/w r/w r/w r/w r/w ? bits 7 and 6 (group 3 compare match select 1 and 0 (g3cms1 and g3cms0)): g3cms1 and g3cms0 select the compare match that triggers tpc output group 3 (tp15?p12). bit 7: g3cms1 bit 6: g3cms0 description 0 0 tpc output group 3 (tp15?p12) output is triggered by compare match in itu channel 0 1 tpc output group 3 (tp15?p12) output is triggered by compare match in itu channel 1 1 0 tpc output group 3 (tp15?p12) output is triggered by compare match in itu channel 2 1 tpc output group 3 (tp15?p12) output is triggered by compare match in itu channel 3 (initial value)
320 ? bits 5 and 4 (group 2 compare match select 1 and 0 (g2cms1 and g2cms0)): g2cms1 and g2cms0 select the itu channel that triggers tpc output group 2 (tp11?p8). bit 5: g2cms1 bit 4: g2cms0 description 0 0 tpc output group 2 (tp11?p18) output is triggered by compare match in itu channel 0 1 tpc output group 2 (tp11?p18) output is triggered by compare match in itu channel 1 1 0 tpc output group 2 (tp11?p18) output is triggered by compare match in itu channel 2 1 tpc output group 2 (tp11?p18) output is triggered by compare match in itu channel 3 (initial value) ? bits 3 and 2 (group 1 compare match select 1 and 0 (g1cms1 and g1cms0)): g1cms1 and g1cms0 select the itu channel that triggers tpc output group 1 (tp7?p4). bit 3: g1cms1 bit 2: g1cms0 description 0 0 tpc output group 1 (tp7?p4) output is triggered by compare match in itu channel 0 1 tpc output group 1 (tp7?p4) output is triggered by compare match in itu channel 1 1 0 tpc output group 1 (tp7?p4) output is triggered by compare match in itu channel 2 1 tpc output group 1 (tp7?p4) output is triggered by compare match in itu channel 3 (initial value) ? bits 1 and 0 (group 0 compare match select 1 and 0 (g0cms1 and g0cms0)): g0cms1 and g0cms0 select the itu channel that triggers tpc output group 0 (tp3?p0). bit 1: g0cms1 bit 0: g0cms0 description 0 0 tpc output group 0 (tp3?p0) output is triggered by compare match in itu channel 0 1 tpc output group 0 (tp3?p0) output is triggered by compare match in itu channel 1 1 0 tpc output group 0 (tp3?p0) output is triggered by compare match in itu channel 2 1 tpc output group 0 (tp3?p0) output is triggered by compare match in itu channel 3 (initial value)
321 11.2.8 tpc output mode register (tpmr) tpmr is an eight-bit read/write register that selects between the tpc? ordinary output and non- overlap output modes in group units. during non-overlap operation, the output waveform cycle is set in itu general register b (grb) for use as the output trigger and a non-overlap period is set in general register a (gra). the output value then changes on compare matches a and b. for details, see section 11.3.4, tpc output non-overlap operation. tpmr is initialized to h'f0 by a reset. it is not initialized in standby mode. bit: 7 6 5 4 3 2 1 0 bit name: g3nov g2nov g1nov g0nov initial value: 1 1 1 1 0 0 0 0 r/w: r/w r/w r/w r/w ? bits 7? (reserved): these bits are always read as 1. the write value should always be 1. ? bit 3 (group 3 non-overlap mode (g3nov)): g3nov selects ordinary or non-overlap mode for tpc output group 3 (tp15?p12). bit 3: g3nov description 0 tpc output group 3 operates normally (output value updated according to compare match a of the itu channel selected by tpcr) (initial value) 1 tpc output group 3 operates in non-overlap mode (1 output and 0 output can be performed independently according to compare match a and b of the itu channel selected by tpcr) ? bit 2 (group 2 non-overlap mode (g2nov)): g2nov selects ordinary or non-overlap mode for tpc output group 2 (tp11?p8). bit 2: g2nov description 0 tpc output group 2 operates normally (output value updated according to compare match a of the itu channel selected by tpcr) (initial value) 1 tpc output group 2 operates in non-overlap mode (1 output and 0 output can be performed independently according to compare match a and b of the itu channel selected by tpcr)
322 ? bit 1 (group 1 non-overlap mode (g1nov)): g1nov selects ordinary or non-overlap mode for tpc output group 1 (tp7?p4). bit 1: g1nov description 0 tpc output group 1 operates normally (output value updated according to compare match a of the itu channel selected by tpcr) (initial value) 1 tpc output group 1 operates in non-overlap mode (1 output and 0 output can be performed independently according to compare match a and b of the itu channel selected by tpcr) ? bit 0 (group 0 non-overlap mode (g0nov)): g0nov selects ordinary or non-overlap mode for tpc output group 0 (tp3?p0). bit 0: g0nov description 0 tpc output group 0 operates normally (output value updated according to compare match a of the itu channel selected by tpcr) (initial value) 1 tpc output group 0 operates in non-overlap mode (1 output and 0 output can be performed independently according to compare match a and b of the itu channel selected by tpcr) 11.3 operation 11.3.1 overview when corresponding bits in the pbcr1, pbcr2, ndera, and nderb registers are set to 1, tpc output is enabled and the pbdr data register values are output. after that, when the compare match event selected by tpcr occurs, the next data register contents (ndra and ndrb) are transferred to pbdr and output values are updated. figure 11.2 illustrates the tpc output operation.
323 cr q nder q tpc output pin port function select dr q c d ndr qd internal data bus output trigger signal figure 11.2 tpc output operation if new data is written in next data registers a and b before the next compare match occurs, a maximum 16 bits of data can be output at each successive compare match. see section 11.3.4, tpc output non-overlap operation, for details on non-overlap operation. 11.3.2 output timing if tpc output is enabled, next data register (ndra/ndrb) contents are transferred to the data register (pbdr) and output when the selected compare match occurs. figure 11.3 shows the timing of these operations. the example is for ordinary output upon compare match a with groups 2 and 3.
324 n m ck tcnt gra compare match a signal ndrb n + 1 pbdr tp15 tp8 n n mn n figure 11.3 transfer and output timing for ndrb data (example) 11.3.3 examples of use of ordinary tpc output settings for ordinary tpc output (figure 11.4): 1. select gra as the output compare register (output disable) with the timer i/o control register (tior). 2. set the tpc output trigger cycle. 3. select the counter clock with the tpsc2?psc0 bits in the timer control register (tcr). select the counter clear sources with the cclr1 and cclr0 bits. 4. set the timer interrupt enable register (tier) to enable imia interrupts. transfers to ndr can also be set using the dmac. 5. set the initial output value in the i/o port data register to be used by the tpc. 6. set the i/o port control register to be used by the tpc as the tp pin function (11). 7. set to 1 the bit that performs tpc output to the next data enable register (nder). 8. select the itu compare match that will be the tpc output trigger using the tpc output control register (tpcr). 9. set the next tpc output value in ndr. 10. set 1 in the str bit of the timer start register (tstr) and start the timer counter. 11. set the next output value in ndr whenever an imia interrupt is generated.
325 yes no set count operation set gra select gr function itu setting port and tpc setting itu setting (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (11) compare match? ordinary tpc output operation set next tpc output value set next tpc output value start count select tpc output trigger set tpc output enable set port output set initial output value select interrupt request figure 11.4 example of setting procedure for ordinary tpc output
326 five-phase pulse output (figure 11.5): figure 11.5 shows an example of 5-phase pulse output generated at regular intervals using tpc output. 1. set the gra register of the itu that serves as output trigger as the output compare register. set the cycle time in gra of the itu and select counter clearing upon compare match a. set the imiea bit in tier to 1 to enable the compare match a interrupt. 2. write h'ffc0 in pbcr1, write h'f8 in nderb, and set g3cms0, g3cms1, g2cms1, and g2cms0 in tpcr to set the itu compare match selected in step 1 as the output trigger. write output data h'80 in ndrb. 3. when the selected itu channel starts operating and a compare match occurs, the values in ndrb are transferred to pbdr and output. the compare match/input capture a (imia) interrupt handling routine writes the next output data (h'c0) in ndrb. 4. five-phase pulse output can be obtained by writing h'40, h'60, h'20, h'30, h'10, h'18, h'08, h'88?at successive compare match interrupts. if the dma controller is set for activation by compare match, pulse output can be obtained without imposing a load on the cpu. tcnt value tcnt compare matches gra 8000 c000 4000 6000 2000 3000 1000 1800 0800 8800 8000 c000 time h'0000 ndrb pbdr tp15 tp14 tp13 tp12 tp11 80 c0 40 60 20 30 10 18 08 88 80 c0 figure 11.5 tpc output example (5-phase pulse output)
327 11.3.4 tpc output non-overlap operation setting procedures for tpc output non-overlap operation (figure 11.6): 1. select gra and grb as output compare registers (output disable) with the timer i/o control register (tior). 2. set the tpc output trigger cycle in grb and the non-overlap cycle in gra. 3. select the counter clock with the tpsc2?psc0 bits in the timer control register (tcr). select the counter clear sources with the cclr1 and cclr0 bits. 4. set the timer interrupt enable register (tier) to enable imia interrupts. transfers to ndr can also be set using the dmac. 5. set the initial output value in the i/o port data register to be used by the tpc. 6. set the i/o port control register to be used by the tpc as the tp pin function (11). 7. set to 1 the bit that performs tpc output to the next data enable register (nder). 8. select the itu compare match that will be the tpc output trigger using the tpc output control register (tpcr). 9. select the group that performs non-overlap operation in the tpc output mode register (tpmr). 10. set the next tpc output value in ndr. 11. set 1 in the str bit of the timer start register (tstr) and start the timer counter. 12. set the next output value in ndr whenever an imia interrupt is generated.
328 itu setting port and tpc setting itu setting yes no start count set tpc output set count operation set gra select gr function (1) (2) (3) (4) (5) (6) (7) (8) (9) (11) (12) compare match a? (10) select interrupt request set tpc transfer enable select tpc output trigger select non-overlap group set next tpc output value tpc output non- overlap operation set next tpc output value set initial output value figure 11.6 example of setting procedure for tpc output non-overlap operation
329 tpc output non-overlap operation (four-phase complementary non-overlap output) (figure 11.7): 1. set the gra and grb registers of the itu that serves as output triggers as output compare registers. set the cycle in grb and the non-overlap cycle time in gra and select counter clearing upon compare match b. set the imiea bit in tier to 1 to enable the imia interrupt. 2. write h'ffff in pbcr1, write h'ff in nderb, and set g3cms1, g3cms0, g2cms1, and g2cms0 in tpcr to set the itu compare match selected in step 1 as the output trigger. set the g3nov and g2nov bits in tpmr to 1 to set non-overlap operation. write output data h'95 in ndrb. 3. when the selected itu channel starts operating and a grb compare match occurs, 1 output changes to 0 output; when a gra compare match occurs, 0 output changes to 1 output. (the change from 0 output to 1 output is delayed by the value set in gra.) the imia interrupt handling routine writes the next output data (h'65) in ndrb. 4. four-phase complementary non-overlap output can be obtained by writing h'59, h'56, h'95 at successive imia interrupts. if the dma controller is set for activation by compare match, pulse output can be obtained without imposing a load on the cpu.
330 95 65 59 56 95 65 ndrb h'0000 gra grb pbdr tp15 tp14 tp13 tp12 tp11 tp9 tp8 tp10 tcnt value tcnt 00 95 05 65 41 59 50 56 14 95 05 65 time non-overlap cycle figure 11.7 non-overlap output example (four-phase complementary output)
331 11.3.5 tpc output by input capture tpc can also be output by using input capture rather than itu compare matches. the general register a (gra) of the itu selected by tpcr functions as an input capture register and tpc output occurs in response to an input capture signal. figure 11.8 shows the timing. mn n ck tioc pin input capture signal ndr dr figure 11.8 tpc output by input capture
332 11.4 usage notes 11.4.1 non-overlap operation during non-overlap operation, transfers from ndr to data registers (dr) occur as follows. 1. ndr contents are always transferred to dr on compare match a. 2. the contents of bits transferred from ndr are only transferred on compare match b when they are 0. no transfer occurs for a 1. figure 11.9 illustrates tpc output during non-overlap operation. cr q nder q tpc output pin port function select dr q c d ndr qd compare match a compare match b figure 11.9 tpc output non-overlap operation
333 when a compare match b occurs before the compare match a, the 0 data transfer can be performed before the 1 data transfer, so a non-overlapping waveform can be output. in such cases, be sure not to change the ndr contents until the compare match a after the compare match b occurs (non-overlap period). this can be ensured by writing the next data to ndr in the imia interrupt handling routine. the dmac can also be started using an imia interrupt. however, these write operations should be performed prior to the next compare match b. the timing is shown in figure 11.10. compare match a compare match b ndr dr ndr write ndr write 0/1 output 0 output ndr write disable period ndr write period 0/1 output 0 output ndr write disable period ndr write period figure 11.10 non-overlap operation and ndr write timing
334
335 section 12 watchdog timer (wdt) 12.1 overview the superh microcomputer has a one-channel watchdog timer (wdt) for monitoring system operations. if the system becomes uncontrolled and the timer counter overflows without being rewritten correctly by the cpu, an overflow signal ( wdtovf ) is output externally. the wdt can simultaneously generate an internal reset signal for the entire chip. when this watchdog function is not needed, the wdt can be used as an interval timer. in the interval timer operation, an interval timer interrupt is generated at each counter overflow. the wdt is also used in recovering from standby mode. 12.1.1 features wdt features are listed below: ? watchdog timer mode interval timer mode can be selected. ? outputs wdtovf in or watchdog timer mode. when the counter overflows in watchdog timer mode, overflow signal wdtovf is output externally. it is possible to select whether or not to reset the chip internally when this happens. either the power-on reset or manual reset signal can be selected as the internal reset signal. ? generates interrupts in interval timer mode. when the counter overflows, it generates an interval timer interrupt. ? used to clear standby mode. ? selection of eight counter clock sources
336 12.1.2 block diagram figure 12.1 shows a block diagram of the wdt. /2 /64 /128 /256 /512 /1024 /4096 /8192 internal clock sources clock overflow clock select interrupt control reset control rstcsr tcnt tcsr module bus bus interface internal data bus iti (interrupt signal) wdtovf internal reset signal * wdt tcsr: timer control/status register tcnt: timer counter rstcsr: reset control/status register note: * the internal reset signal can be generated by a register setting. the type of reset can be selected (power-on or manual reset). figure 12.1 block diagram of wdt 12.1.3 pin configuration table 12.1 shows the pin configuration. table 12.1 pin configuration pin abbreviation i/o function watchdog timer overflow wdtovf o outputs the counter overflow signal in watchdog mode
337 12.1.4 register configuration table 12.2 summarizes the three wdt registers. they are used to select the clock, switch the wdt mode, and control the reset signal. table 12.2 wdt registers initial address * 4 name abbreviation r/w value write * 1 read * 2 timer control/status register tcsr r/(w) * 3 h'18 h'5ffffb8 h'5ffffb8 timer counter tcnt r/w h'00 h'5ffffb9 reset control/status register rstcsr r/(w) * 3 h'1f h'5ffffba h'5ffffbb notes: * 1 write by word transfer. a byte or longword write cannot be used. * 2 read by byte transfer. the correct value cannot be obtained by a word or longword read. * 3 only 0 can be written in bit 7, to clear the flag. * 4 only the values of bits a27?24 and a8?0 are valid; bits a23?9 are ignored. for details on the register addresses, see section 8.3.5, area descriptions 12.2 register descriptions 12.2.1 timer counter (tcnt) tcnt is an eight-bit readable and writable up-counter. tcnt differs from other registers in that it is more difficult to write. see section 12.2.4, notes on register access, for details. when the timer enable bit (tme) in the timer control/status register (tcsr) is set to 1, the timer counter starts counting pulses of an internal clock source selected by clock select bits 2? (cks2?ks0) in tcsr. when the value of tcnt overflows (changes from h'ff to h'00), a watchdog timer overflow signal ( wdtovf ) or interval timer interrupt (iti) is generated, depending on the mode selected with the wt/ it bit in tcsr. tcnt is initialized to h'00 by a reset and when the tme bit is cleared to 0. it is not initialized in standby mode. bit: 7 6 5 4 3 2 1 0 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w
338 12.2.2 timer control/status register (tcsr) the timer control/status register (tcsr) is an eight-bit read/write register. tcsr differs from other registers in being more difficult to write. see section 12.2.4, register access, for details. its functions include selecting the timer mode and clock source. bits 7? are initialized to 000 by a reset and in standby mode. bits 2? are initialized to 000 by a reset, but retain their values in standby mode. bit: 7 6 5 4 3 2 1 0 bit name: ovf wt/ it tme cks2 cks1 cks0 initial value: 0 0 0 1 1 0 0 0 r/w: r/(w) * r/w r/w r/w r/w r/w note: * only 0 can be written, to clear the flag. ? bit 7 (overflow flag (ovf)): ovf indicates that tcnt has overflowed from h'ff to h'00 in interval timer mode. it is not set in watchdog timer mode. bit 7: ovf description 0 no overflow of tcnt in interval timer mode (initial value) cleared by reading ovf, then writing 0 in ovf 1 tcnt overflow in interval timer mode ? bit 6 (timer mode select (wt/ it )): wt/ it selects whether to use the wdt as a watchdog timer or interval timer. when tcnt overflows, the wdt either generates an interval timer interrupt (iti) or generates a wdtovf signal, depending on the mode selected. bit 6: wt/ it description 0 interval timer mode: interval timer interrupt to the cpu when tcnt overflows (initial value) 1 watchdog timer mode: wdtovf signal output externally when tcnt overflows. section 12.2.3, reset control/status register (rstcsr), describes in detail what happens when tcnt overflows in watchdog timer mode. ? bit 5 (timer enable (tme)): tme enables or disables the timer. bit 5: tme description 0 timer disabled: tcnt is initialized to h'00 and count-up stops (initial value) 1 timer enabled: tcnt starts counting. a wdtovf signal or interrupt is generated when tcnt overflows.
339 ? bits 4 and 3 (reserved): these bits are always read as 1. the write value should always be 1. ? bits 2? (clock select 2? (cks2?ks0)): cks2?ks0 select one of eight internal clock sources for input to tcnt. the clock signals are obtained by dividing the frequency of the system clock ( ). description bit 2: cks2 bit 1: cks1 bit 0: cks0 clock source overflow interval * ( = 20 mhz) 00 0 /2 (initial value) 25.6 s 00 1 /64 819.2 s 01 0 /128 1.6 ms 01 1 /256 3.3 ms 10 0 /512 6.6 ms 10 1 /1024 13.1 ms 11 0 /4096 52.4 ms 11 1 /8192 104.9 ms note: * the overflow interval listed is the time from when the tcnt begins counting at h'00 until an overflow occurs. 12.2.3 reset control/status register (rstcsr) rstcsr is an eight-bit read/write register that controls output of the reset signal generated by timer counter (tcnt) overflow and selects the internal reset signal type. rstcsr differs from other registers in that it is more difficult to write. see section 12.2.4, notes on register access, for details. rstcr is initialized to h'1f by input of a reset signal from the res pin, but is not initialized by the internal reset signal generated by overflow of the wdt. it is initialized to h'1f in standby mode. bit: 7 6 5 4 3 2 1 0 bit name: wovf rste rsts initial value: 0 0 0 1 1 1 1 1 r/w: r/(w) * r/w r/w note: * only 0 can be written in bit 7, to clear the flag.
340 ? bit 7 (watchdog timer overflow (wovf)): wovf indicates that tcnt has overflowed (from h'ff to h'00) in watchdog timer mode. it is not set in interval timer mode. bit 7: wovf description 0 no tcnt overflow in watchdog timer mode (initial value) cleared when software reads wovf, then writes 0 in wovf 1 set by tcnt overflow in watchdog timer mode ? bit 6 (reset enable (rste)): rste selects whether to reset the chip internally if the tcnt overflows in watchdog timer mode. bit 6: rste description 0 not reset when tcnt overflows (initial value) lsi not reset internally, but tcnt and tcsr reset within wdt. 1 reset when tcnt overflows ? bit 5 (reset select (rsts)): rsts selects the type of internal reset generated if tcnt overflows in watchdog timer mode. bit 5: rsts description 0 power-on reset (initial value) 1 manual reset ? bits 4? (reserved): these bits are always read as 1. the write value should always be 1. 12.2.4 notes on register access the watchdog timer? tcnt, tcsr, and rstcsr registers differ from other registers in that they are more difficult to write. the procedures for writing and reading these registers are given below. writing to tcnt and tcsr: these registers must be written by a word transfer instruction. they cannot be written by byte transfer instructions. tcnt and tcsr both have the same write address. the write data must be contained in the lower byte of the written word. the upper byte must be h'5a (for tcnt) or h'a5 (for tcsr) (figure 12.2). this transfers the write data from the lower byte to tcnt or tcsr.
341 writing to tcnt 15 8 7 0 address: h'5ffffb8 h'5a write data writing to tcsr 15 8 7 0 address: h'5ffffb8 h'a5 write data figure 12.2 writing to tcnt and tcsr writing to rstcsr: rstcsr must be written by a word access to address h'5fffffba. it cannot be written by byte transfer instructions. procedures for writing 0 in wovf (bit 7) and for writing to rste (bit 6) and rsts (bit 5) are different, as shown in figure 12.3. to write 0 in the wovf bit, the write data must be h'a5 in the upper byte and h'00 in the lower byte. this clears the wovf bit to 0. the rste and rsts bits are not affected. to write to the rste and rsts bits, the upper byte must be h'5a and the lower byte must be the write data. the values of bits 6 and 5 of the lower byte are transferred to the rste and rsts bits, respectively. the wovf bit is not affected. writing 0 to the wovf bit 15 8 7 0 address: h'5ffffba h'a5 h'00 writing to the rste and rsts bits 15 8 7 0 address: h'5ffffba h'5a write data figure 12.3 writing to rstcsr reading from tcnt, tcsr, and rstcsr: tcnt, tcsr, and rstcsr are read like other registers. use byte transfer instructions. the read addresses are h'5ffffb8 for tcsr, h'5ffffb9 for tcnt, and h'5ffffbb for rstcsr.
342 12.3 operation 12.3.1 operation in watchdog timer mode to use the wdt as a watchdog timer, set the wt/ it and tme bits in tcsr to 1. software must prevent tcnt overflow by rewriting the tcnt value (normally by writing h'00) before overflow occurs. if tcnt fails to be rewritten and overflows due to a system crash or the like, a wdtovf signal is output (figure 12.4). the wdtovf signal can be used to reset external system devices. the wdtovf signal is output for 128 clock cycles. if the rste bit in rstcsr is set to 1, a signal to reset the chip will be generated internally simultaneous to the wdtovf signal when tcnt overflows. either a power-on reset or a manual reset can be selected by the rsts bit in rstcsr. the internal reset signal is output for 512 clock cycles. when a watchdog reset is generated simultaneously with input at the res pin, the software distinguishes the res reset from the watchdog reset by checking the wovf bit in rstcsr. the res reset takes priority. the wovf bit is cleared to 0.
343 h'ff h'00 overflow wt/ it wdtovf wdtovf it it figure 12.4 operation in watchdog timer mode
344 12.3.2 operation in interval timer mode to use the wdt as an interval timer, clear wt/ it it figure 12.5 operation in interval timer mode 12.3.3 operation in standby mode the watchdog timer has a special function to clear standby mode with an nmi interrupt. when using standby mode, set the wdt as described below. transition to standby mode: the tme bit in tcsr must be cleared to 0 to stop the watchdog timer counter before it enters standby mode. the chip cannot enter standby mode while the tme bit is set to 1. set bits cks2 cks0 so that the counter overflow interval is equal to or longer than the oscillation settling time. see sections 20.1.3 and 20.2.3, ac characteristics, for the oscillation settling time. recovery from standby mode: when an nmi request signal is received in standby mode, the clock oscillator starts running and the watchdog timer starts counting at the rate selected by bits cks2 cks0 before standby mode was entered. when tcnt overflows (changes from h'ff to h'00), the system clock (
345 12.3.4 timing of overflow flag (ovf) setting in interval timer mode, when tcnt overflows the ovf flag in tcsr is set to 1 and an interval timer interrupt is requested (figure 12.6). h'ff h'00 ck tcnt overflow signal (internal signal) ovf figure 12.6 timing of ovf setting 12.3.5 timing of watchdog timer overflow flag (wovf) setting when tcnt overflows the wovf bit in rstcsr is set to 1 and a wdtovf figure 12.7 timing of wovf bit setting and internal reset
346 12.4 usage notes 12.4.1 tcnt write and increment contention if a timer counter clock pulse is generated during the t3 state of a write cycle to tcnt, the write takes priority and the timer counter is not incremented (figure 12.8). ck address internal write signal tcnt input clock tcnt nm tcnt address counter write data t1 t2 t3 tcnt write cycle figure 12.8 contention between tcnt write and increment 12.4.2 changing cks2?ks0 bit values if the values of bits cks2 cks0 are altered while the wdt is running, the count may increment incorrectly. always stop the watchdog timer (by clearing the tme bit to 0) before changing the values of bits cks2 cks0. 12.4.3 changing watchdog timer/interval timer modes to prevent incorrect operation, always stop the watchdog timer (by clearing the tme bit to 0) before switching between interval timer mode and watchdog timer mode.
347 12.4.4 system reset with wdtovf wdtovf res wdtovf res wdtovf figure 12.9 example of system reset circuit using wdtovf signal 12.4.5 internal reset with watchdog timer if the rste bit is cleared to 0 in watchdog timer mode, the chip will not reset internally when a tcnt overflow occurs, but tcnt and tcsr in the wdt will reset.
348
349 section 13 serial communication interface (sci) 13.1 overview the superh microcomputer has a serial communication interface (sci) with two independent channels. both channels are functionally identical. the sci supports both asynchronous and synchronous serial communication. it also has a multiprocessor communication function for serial communication between two or more processors. 13.1.1 features sci features are listed below: ? asynchronous mode ? serial data communication is synchronized using a start-stop method in character units. the sci can communicate with a universal asynchronous receiver/transmitter (uart), an asynchronous communication interface adapter (acia), or any other chip that employs standard asynchronous serial communication. it can also communicate with two or more other processors using the multiprocessor communication function. there are twelve selectable serial data communication formats. ? data length: seven or eight bits ? stop bit length: one or two bits ? parity: even, odd, or none ? multiprocessor bit: one or none ? receive error detection: parity, overrun, and framing errors ? break detection: by reading the rxd level directly when a framing error occurs ? synchronous mode ? serial data communication is synchronized with a clock signal. the sci can communicate with other chips having a synchronous communication function. there is one serial data communication format. ? data length: eight bits ? receive error detection: overrun errors ? full duplex communication: the transmitting and receiving sections are independent, so the sci can transmit and receive simultaneously. both sections use double buffering, so continuous data transfer is possible in both the transmit and receive directions. ? on-chip baud rate generator with selectable bit rates ? internal or external transmit/receive clock source: baud rate generator (internal) or sck pin (external)
350 ? four types of interrupts: transmit-data-empty, transmit-end, receive-data-full, and receive- error interrupts are requested independently. the transmit-data-empty and receive-data-full interrupts can start the direct memory access controller (dmac) to transfer data. 13.1.2 block diagram figure 13.1 shows a block diagram of the sci. parity generation parity check transmit/ receive control baud rate generator clock external clock bus interface internal data bus rxd rdr tdr rsr tsr ssr scr smr brr /4 /16 /64 tei txi rxi eri sck txd sci module data bus rsr: receive shift register smr: serial mode register rdr: receive data register scr: serial control register tsr: transmit shift register ssr: serial status register tdr: transmit data register brr: bit rate register figure 13.1 block diagram of sci
351 13.1.3 input/output pins table 13.1 summarizes the sci pins by channel. table 13.1 sci pins channel pin name abbreviation input/output function 0 serial clock pin sck0 input/output sci0 clock input/output receive data pin rxd0 input sci0 receive data input transmit data pin txd0 output sci0 transmit data output 1 serial clock pin sck1 input/output sci1 clock input/output receive data pin rxd1 input sci1 receive data input transmit data pin txd1 output sci1 transmit data output 13.1.4 register configuration table 13.2 summarizes the sci internal registers. these registers select the communication mode (asynchronous or synchronous), specify the data format and bit rate, and control the transmitter and receiver sections.
352 table 13.2 registers channel address * 1 name abbreviation r/w initial value access size 0 h'05fffec0 serial mode register smr0 r/w h'00 8, 16 h'05fffec1 bit rate register brr0 r/w h'ff 8, 16 h'05fffec2 serial control register scr0 r/w h'00 8, 16 h'05fffec3 transmit data register tdr0 r/w h'ff 8, 16 h'05fffec4 serial status register ssr0 r/(w) * 2 h'84 8, 16 h'05fffec5 receive data register rdr0 r h'00 8, 16 1 h'05fffec8 serial mode register smr1 r/w h'00 8, 16 h'05fffec9 bit rate register brr1 r/w h'ff 8, 16 h'05fffeca serial control register scr1 r/w h'00 8, 16 h'05fffecb transmit data register tdr1 r/w h'ff 8, 16 h'05fffecc serial status register ssr1 r/(w) * 2 h'84 8, 16 h'05fffecd receive data register rdr1 r h'00 8, 16 notes: * 1 only the values of bits a27?24 and a8?0 are valid; bits a23?9 are ignored. for details on the register addresses, see section 8.3.5, area descriptions. * 2 only 0 can be written, to clear flags. 13.2 register descriptions 13.2.1 receive shift register the receive shift register (rsr) receives serial data. data input at the rxd pin is loaded into rsr in the order received, lsb (bit 0) first. in this way the sci converts received data to parallel form. when one byte has been received, it is automatically transferred to the receive data register (rdr). the cpu cannot read or write to rsr directly. bit: 7 6 5 4 3 2 1 0 bit name: r/w: 13.2.2 receive data register the receive data register (rdr) stores serial receive data. the sci completes the reception of one byte of serial data by moving the received data from the receive shift register (rsr) into rdr for storage. rsr is then ready to receive the next data. this double buffering allows the sci to receive data continuously.
353 the cpu can read but not write to rdr. rdr is initialized to h'00 by a reset and in standby mode. bit: 7 6 5 4 3 2 1 0 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: r r r r r r r r 13.2.3 transmit shift register the transmit shift register (tsr) transmits serial data. the sci loads transmit data from the transmit data register (tdr) into tsr, then transmits the data serially from the txd pin, lsb (bit 0) first. after transmitting one data byte, the sci automatically loads the next transmit data from tdr into tsr and starts transmitting again. if the tdre bit in ssr is 1, however, the sci does not load the tdr contents into tsr. the cpu cannot read or write to tsr directly. bit: 7 6 5 4 3 2 1 0 bit name: r/w: 13.2.4 transmit data register the transmit data register (tdr) is an eight-bit register that stores data for serial transmission. when the sci detects that the transmit shift register (tsr) is empty, it moves transmit data written in tdr into tsr and starts serial transmission. continuous serial transmission is possible by writing the next transmit data in tdr during serial transmission from tsr. the cpu can always read and write to tdr. tdr is initialized to h'ff by a reset and in standby mode. bit: 7 6 5 4 3 2 1 0 bit name: initial value: 1 1 1 1 1 1 1 1 r/w: r/w r/w r/w r/w r/w r/w r/w r/w
354 13.2.5 serial mode register the serial mode register (smr) is an eight-bit register that specifies the sci serial communication format and selects the clock source for the baud rate generator. the cpu can always read and write to smr. smr is initialized to h'00 by a reset and in standby mode. bit: 7 6 5 4 3 2 1 0 bit name: c/ a chr pe o/ e stop mp cks1 cks0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w ? bit 7 (communication mode (c/ a )): c/ a selects whether the sci operates in asynchronous or synchronous mode. bit 7: c/ a description 0 asynchronous mode (initial value) 1 synchronous mode ? bit 6 (character length (chr)): chr selects seven-bit or eight-bit data in asynchronous mode. in synchronous mode, the data length is always eight bits, regardless of the chr setting. bit 6: chr description 0 eight-bit data (initial value) 1 seven-bit data. when seven-bit data is selected, the msb (bit 7) of the transmit data register is not transmitted. ? bit 5 (parity enable (pe)): pe selects whether to add a parity bit to transmit data and check the parity of receive data, in asynchronous mode. in synchronous mode, a parity bit is neither added nor checked, regardless of the pe setting. bit 5: pe description 0 parity bit not added or checked (initial value) 1 parity bit added and checked. when pe is set to 1, an even or odd parity bit is added to transmit data, depending on the parity mode (o/ e ) setting. receive data parity is checked according to the even/odd (o/ e ) mode setting.
355 ? bit 4 (parity mode (o/ e ): o/ e selects even or odd parity when parity bits are added and checked. the o/ e setting is used only in asynchronous mode and only when the parity enable bit (pe) is set to 1 to enable parity addition and checking. the o/ e setting is ignored in synchronous mode, or in asynchronous mode when parity addition and checking is disabled. bit 4: o/ e description 0 even parity (initial value) if even parity is selected, the parity bit added to transmit data makes an even number of 1s in the transmitted character and parity bit combined. receive data must have an even number of 1s in the received character and parity bit combined. 1 odd parity if odd parity is selected, the parity bit added to transmit data makes an odd number of 1s in the transmitted character and parity bit combined. receive data must have an odd number of 1s in the received character and parity bit combined. ? bit 3 (stop bit length (stop)): stop selects one or two bits as the stop bit length in asynchronous mode. this setting is used only in asynchronous mode. it is ignored in synchronous mode because no stop bits are added. in receiving, only the first stop bit is checked, regardless of the stop bit setting. if the second stop bit is 1, it is treated as a stop bit. if the second stop bit is 0, it is treated as the start bit of the next incoming character. bit 3: stop description 0 one stop bit (initial value) in transmitting, a single 1-bit is added at the end of each transmitted character. 1 two stop bits. in transmitting, two 1-bits are added at the end of each transmitted character. ? bit 2 (multiprocessor mode (mp)): mp selects multiprocessor format. when multiprocessor format is selected, settings of the parity enable (pe) and parity mode (o/ e ) bits are ignored. the mp bit setting is used only in asynchronous mode; it is ignored in synchronous mode. for the multiprocessor communication function, see section 13.3.3, multiprocessor communication. bit 2: mp description 0 multiprocessor function disabled (initial value) 1 multiprocessor format selected
356 ? bits 1 and 0 (clock select 1 and 0 (cks1 and cks0)): cks1 and cks0 select the internal clock source of the on-chip baud rate generator. four clock sources are available: , /4, /16, and /64. for further information on the clock source, bit rate register settings, and baud rate, see section 13.2.8, bit rate register (brr). bit 1: cks1 bit 0: cks0 description 0 0 system clock ( ) (initial value) 1 /4 10 /16 1 /64 13.2.6 serial control register the serial control register (scr) enables the sci transmitter/receiver, selects serial clock output in asynchronous mode, enables and disables interrupts, and selects the transmit/receive clock source. the cpu can always read and write to scr. scr is initialized to h'00 by a reset and in standby mode. bit: 7 6 5 4 3 2 1 0 bit name: tie rie te re mpie teie cke1 cke0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w ? bit 7 (transmit interrupt enable (tie)): tie enables or disables the transmit-data-empty interrupt (txi) requested when the transmit data register empty bit (tdre) in the serial status register (ssr) is set to 1 due to transfer of serial transmit data from tdr to tsr. bit 7: tie description 0 transmit-data-empty interrupt request (txi) is disabled (initial value) the txi interrupt request can be cleared by reading tdre after it has been set to 1, then clearing tdre to 0, or by clearing tie to 0. 1 transmit-data-empty interrupt request (txi) is enabled
357 ? bit 6 (receive interrupt enable (rie)): rie enables or disables the receive-data-full interrupt (rxi) requested when the receive data register full bit (rdrf) in the serial status register (ssr) is set to 1 due to transfer of serial receive data from rsr to rdr. also enables or disables receive-error interrupt (eri) requests. bit 6: rie description 0 receive-data-full interrupt (rxi) and receive-error interrupt (eri) requests are disabled (initial value) rxi and eri interrupt requests can be cleared by reading the rdrf flag or error flag (fer, per, or orer) after it has been set to 1, then clearing the flag to 0, or by clearing rie to 0. 1 receive-data-full interrupt (rxi) and receive-error interrupt (eri) requests are enabled bit 5 (transmit enable (te)): te enables or disables the sci transmitter. bit 5: te description 0 transmitter disabled (initial value) the transmit data register empty bit (tdre) in the serial status register (ssr) is fixed at 1. 1 transmitter enabled. serial transmission starts when the transmit data register empty (tdre) bit in the serial status register (ssr) is cleared to 0 after writing transmit data into tdr. select the transmit format in smr before setting te to 1. ? bit 4 (receive enable (re)): re enables or disables the sci receiver. bit 4: re description 0 receiver disabled (initial value) clearing re to 0 does not affect the receive flags (rdrf, fer, per, orer). these flags retain their previous values. 1 receiver enabled. serial reception starts when a start bit is detected in asynchronous mode, or serial clock input is detected in synchronous mode. select the receive format in smr before setting re to 1. ? bit 3 (multiprocessor interrupt enable (mpie)): mpie enables or disables multiprocessor interrupts. the mpie setting is used only in asynchronous mode, and only if the multiprocessor mode bit (mp) in the serial mode register (smr) is set to 1 during reception. the mpie setting is ignored in synchronous mode or when the mp bit is cleared to 0.
358 bit 3: mpie description 0 multiprocessor interrupts are disabled (normal receive operation) (initial value) mpe is cleared to 0 when: 1. mpie is cleared to 0, or 2. multiprocessor bit (mpb) is set to 1 in receive data. 1 multiprocessor interrupts are enabled: receive-data-full interrupt requests (rxi), receive-error interrupt requests (eri), and setting of the rdrf, fer, and orer status flags in the serial status register (ssr) are disabled until the multiprocessor bit is set to 1. the sci does not transfer receive data from rsr to rdr, does not detect receive errors, and does not set the rdrf, fer, and orer flags in the serial status register (ssr). when it receives data that includes mpb = 1, mpb is set to 1, and the sci automatically clears mpie to 0, generates rxi and eri interrupts (if the tie and rie bits in scr are set to 1), and allows fer and orer to be set. ? bit 2 (transmit-end interrupt enable (teie)): teie enables or disables the transmit-end interrupt (tei) requested if tdr does not contain new transmit data when the msb is transmitted. bit 2: teie description 0 transmit-end interrupt (tei) requests are disabled (initial value) the tei request can be cleared by reading the tdre bit in the serial status register (ssr) after it has been set to 1, then clearing tdre to 0; by clearing the transmit end (tend) bit to 0; or by clearing the teie bit to 0. 1 transmit-end interrupt (tei) requests are enabled. ? bits 1 and 0 (clock enable 1 and 0 (cke1 and cke0)): cke1 and cke0 select the sci clock source and enable or disable clock output from the sck pin. depending on the combination of cke1 and cke0, the sck pin can be used for general-purpose input/output, serial clock output, or serial clock input. the sck pin function should be selected in advance with the pin function controller (pfc). the cke0 setting is valid only in asynchronous mode, and only when the sci is internally clocked (cke1 = 0). the cke0 setting is ignored in synchronous mode, or when an external clock source is selected (cke1 = 1). select the sci operating mode in the serial mode register (smr) before setting cke1 and cke0. for further details on selection of the sci clock source, see table 13.9 in section 13.3, operation.
359 bit 1: cke1 bit 0: cke0 description * 1 0 0 asynchronous mode internal clock, sck pin used for input pin (input signal is ignored) or output pin (output level is undefined) * 2 (initial value) synchronous mode internal clock, sck pin used for serial clock output * 2 (initial value) 0 1 asynchronous mode internal clock, sck pin used for clock output * 3 synchronous mode internal clock, sck pin used for serial clock output 1 0 asynchronous mode external clock, sck pin used for clock input * 4 synchronous mode external clock, sck pin used for serial clock input 1 1 asynchronous mode external clock, sck pin used for clock input * 4 synchronous mode external clock, sck pin used for serial clock input notes: * 1 the sck pin is multiplexed with other functions. set the pin function controller (pfc) to select the sck function and sck input/output for the sck pin. * 2 initial value * 3 the output clock frequency is the same as the bit rate. * 4 the input clock frequency is 16 times the bit rate. 13.2.7 serial status register the serial status register (ssr) is an 8-bit register containing multiprocessor bit values, and status flags that indicate the sci operating status. the cpu can always read and write to ssr, but cannot write 1 in the status flags (tdre, rdrf, orer, per, and fer). these flags can be cleared to 0 only if they have first been read (after being set to 1). bits 2 (tend) and 1 (mpb) are read-only bits that cannot be written. ssr is initialized to h'84 by a reset and in standby mode. bit: 7 6 5 4 3 2 1 0 bit name: tdre rdrf orer fer per tend mpb mpbt initial value: 1 0 0 0 0 1 0 0 r/w: r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * r r r/w note: * only 0 can be written, to clear the flag. ? bit 7 (transmit data register empty (tdre)): tdre indicates that the sci has loaded transmit data from tdr into tsr and new serial transmit data can be written in tdr.
360 bit 7: tdre description 0 tdr contains valid transmit data tdre is cleared to 0 when: ? software reads tdre after it has been set to 1, then writes 0 in tdre ? the dmac writes data in tdr 1 tdr does not contain valid transmit data (initial value) tdre is set to 1 when: ? the chip is reset or enters standby mode ? the te bit in the serial control register (scr) is cleared to 0 ? tdr contents are loaded into tsr, so new data can be written in tdr ? bit 6 (receive data register full (rdrf)): rdrf indicates that rdr contains received data. bit 6: rdrf description 0 rdr does not contain valid received data (initial value) rdrf is cleared to 0 when: ? the chip is reset or enters standby mode ? software reads rdrf after it has been set to 1, then writes 0 in rdrf ? the dmac reads data from rdr 1 rdr contains valid received data. rdrf is set to 1 when serial data is received normally and transferred from rsr to rdr. note: rdr and rdrf are not affected by detection of receive errors or by clearing of the re bit to 0 in the serial control register. they retain their previous contents. if rdrf is still set to 1 when reception of the next data ends, an overrun error (orer) occurs and the received data is lost. ? bit 5 (overrun error (orer)): indicates that data reception ended abnormally due to an overrun error.
361 bit 5: orer description 0 receiving is in progress or has ended normally * 1 (initial value) orer is cleared to 0 when: ? the chip is reset or enters standby mode ? software reads orer after it has been set to 1, then writes 0 in orer 1 a receive overrun error occurred * 2 orer is set to 1 if reception of the next serial data ends when rdrf is set to 1 notes: * 1 clearing the re bit to 0 in the serial control register does not affect the orer bit, which retains its previous value. * 2 rdr continues to hold the data received before the overrun error, so subsequent receive data is lost. serial receiving cannot continue while orer is set to 1. in synchronous mode, serial transmitting is disabled. ? bit 4 (framing error (fer)): fer indicates that data reception ended abnormally due to a framing error in the asynchronous mode. bit 4: fer description 0 receiving is in progress or has ended normally (initial value) clearing the re bit to 0 in the serial control register does not affect the fer bit, which retains its previous value. fer is cleared to 0 when: ? the chip is reset or enters standby mode ? software reads fer after it has been set to 1, then writes 0 in fer 1 a receive framing error occurred. when the stop bit length is two bits, only the first bit is checked. the second stop bit is not checked. when a framing error occurs, the sci transfers the receive data into rdr but does not set rdrf. serial receiving cannot continue while fer is set to 1. in synchronous mode, serial transmitting is also disabled. fer is set to 1 if the stop bit at the end of receive data is checked and found to be 0. ? bit 3 (parity error (per)): per indicates that data reception (with parity) ended abnormally due to a parity error in asynchronous mode.
362 bit 3: per description 0 receiving is in progress or has ended normally (initial value) clearing the re bit to 0 in the serial control register does not affect the per bit, which retains its previous value. per is cleared to 0 when: ? the chip is reset or enters standby mode ? software reads per after it has been set to 1, then writes 0 in per 1 a receive parity error occurred. when a parity error occurs, the sci transfers the receive data into rdr but does not set rdrf. serial receiving cannot continue while per is set to 1. in synchronous mode, serial transmitting is also disabled. per is set to 1 if the number of 1s in receive data, including the parity bit, does not match the even or odd parity setting of the parity mode bit (o/ e ) in the serial mode register (smr). ? bit 2 (transmit end (tend)): tend indicates that when the last bit of a serial character was transmitted, tdr did not contain new transmit data, so transmission has ended. tend is a read-only bit and cannot be written. bit 2: tend description 0 transmission is in progress tend is cleared to 0 when: ? software reads tdre after it has been set to 1, then writes 0 in tdre ? the dmac writes data in tdr 1 end of transmission (initial value) tend is set to 1 when: ? the chip is reset or enters standby mode ? te is cleared to 0 in the serial control register (scr) ? tdre is 1 when the last bit of a one-byte serial character is transmitted ? bit 1 (multiprocessor bit (mpb)): mpb stores the value of the multiprocessor bit in receive data when a multiprocessor format is selected for receiving in asynchronous mode. the mpb is a read-only bit and cannot be written. bit 1: mpb description 0 multiprocessor bit value in receive data is 0 (initial value) if re is cleared to 0 when a multiprocessor format is selected, mpb retains its previous value. 1 multiprocessor bit value in receive data is 1
363 ? bit 0 (multiprocessor bit transfer (mpbt)): mpbt stores the value of the multiprocessor bit added to transmit data when a multiprocessor format is selected for transmitting in asynchronous mode. the mpbt setting is ignored in synchronous mode, when a multiprocessor format is not selected, or when the sci is not transmitting. bit 0: mpbt description 0 multiprocessor bit value in transmit data is 0 (initial value) 1 multiprocessor bit value in transmit data is 1 13.2.8 bit rate register (brr) the bit rate register (brr) is an eight-bit register that, together with the baud rate generator clock source selected by the cks1 and cks0 bits in the serial mode register (smr), determines the serial transmit/receive bit rate. the cpu can always read and write to brr. brr is initialized to h'ff by a reset and in standby mode. sci0 and sci1 have independent baud rate generator control, so different values can be set in the two channels. bit: 7 6 5 4 3 2 1 0 bit name: initial value: 1 1 1 1 1 1 1 1 r/w: r/w r/w r/w r/w r/w r/w r/w r/w table 13.3 shows examples of brr settings in asynchronous mode; table 13.4 shows examples of bbr settings in synchronous mode.
364 table 13.3 bit rates and brr settings in asynchronous mode (mhz) 2 2.097152 bit rate (bits/s) n n error (%) nn error (%) 110 1 141 0.03 1 148 ?.04 150 1 103 0.16 1 108 0.21 300 0 207 0.16 0 217 0.21 600 0 103 0.16 0 108 0.21 1200 0 51 0.16 0 54 ?.70 2400 0 25 0.16 0 26 1.14 4800 0 12 0.16 0 13 ?.48 9600 0 6 ?.48 19200 31250 0 1 0.00 38400 table 13.3 bit rates and brr settings in asynchronous mode (cont) (mhz) 2.4576 3 3.6864 bit rate(bits/s) n n error (%) n n error (%) n n error (%) 110 1 174 ?.26 1 212 0.03 2 64 0.70 150 1 127 0.00 1 155 0.16 1 191 0.00 300 0 255 0.00 1 77 0.16 1 95 0.00 600 0 127 0.00 0 155 0.16 0 191 0.00 1200 0 63 0.00 0 77 0.16 0 95 0.00 2400 0 31 0.00 0 38 0.16 0 47 0.00 4800 0 15 0.00 0 19 ?.34 0 23 0.00 9600 0 7 0.00 0 9 ?.34 0 11 0.00 19200 0 3 0.00 0 4 ?.34 0 5 0.00 31250 0 2 0.00 38400 0 1 0.00 0 2 0.00
365 table 13.3 bit rates and brr settings in asynchronous mode (cont) (mhz) 4 4.9152 5 bit rate(bits/s) n n error (%) n n error (%) n n error (%) 110 2 70 0.03 2 86 0.31 2 88 ?.25 150 1 207 0.16 1 255 0.00 2 64 0.16 300 1 103 0.16 1 127 0.00 1 129 0.16 600 0 207 0.16 0 255 0.00 1 64 0.16 1200 0 103 0.16 0 127 0.00 0 129 0.16 2400 0 51 0.16 0 63 0.00 0 64 0.16 4800 0 25 0.16 0 31 0.00 0 32 ?.36 9600 0 12 0.16 0 15 0.00 0 15 1.73 19200 0 7 0.00 0 7 1.73 31250 0 3 0.00 0 4 ?.70 0 4 0.00 38400 0 3 0.00 0 3 1.73 table 13.3 bit rates and brr settings in asynchronous mode (cont) (mhz) 6 6.144 7.3728 bit rate(bits/s) n n error (%) n n error (%) n n error (%) 110 2 106 ?.44 2 108 0.08 2 130 ?.07 150 2 77 0.16 2 79 0.00 2 95 0.00 300 1 155 0.16 1 159 0.00 1 191 0.00 600 1 77 0.16 1 79 0.00 1 95 0.00 1200 0 155 0.16 0 159 0.00 0 191 0.00 2400 0 77 0.16 0 79 0.00 0 95 0.00 4800 0 38 0.16 0 39 0.00 0 47 0.00 9600 0 19 ?.34 0 19 0.00 0 23 0.00 19200 0 9 ?.34 0 9 0.00 0 11 0.00 31250 0 5 0.00 0 5 2.40 38400 0 4 ?.34 0 4 0.00 0 5 0.00
366 table 13.3 bit rates and brr settings in asynchronous mode (cont) (mhz) 8 9.8304 10 12 bit rate (bits/s) n n error (%) n n error (%) n n error (%) n n error (%) 110 2 141 0.03 2 174 ?.26 2 177 ?.25 2 212 0.03 150 2 103 0.16 2 127 0.00 2 129 0.16 2 155 0.16 300 1 207 0.16 1 255 0.00 2 64 0.16 2 77 0.16 600 1 103 0.16 1 127 0.00 1 129 0.16 1 155 0.16 1200 0 207 0.16 0 255 0.00 1 64 0.16 1 77 0.16 2400 0 103 0.16 0 127 0.00 0 129 0.16 0 155 0.16 4800 0 51 0.16 0 63 0.00 0 64 0.16 0 77 0.16 9600 0 25 0.16 0 31 0.00 0 32 ?.36 0 38 0.16 19200 0 12 0.16 0 15 0.00 0 15 1.73 0 19 ?.34 31250 0 7 0.00 0 9 ?.70 0 9 0.00 0 11 0.00 38400 0 7 0.00 0 7 1.73 0 9 ?.34 table 13.3 bit rates and brr settings in asynchronous mode (cont) (mhz) 12.288 14 14.7456 16 bit rate (bits/s) n n error (%) n n error (%) n n error (%) n n error (%) 110 2 217 0.08 2 248 ?.17 3 64 0.70 3 70 0.03 150 2 159 0.00 2 181 0.16 2 191 0.00 2 207 0.16 300 2 79 0.00 2 90 0.16 2 95 0.00 2 103 0.16 600 1 159 0.00 1 181 0.16 1 191 0.00 1 207 0.16 1200 1 79 0.00 1 90 0.16 1 95 0.00 1 103 0.16 2400 0 159 0.00 0 181 0.16 0 191 0.00 0 207 0.16 4800 0 79 0.00 0 90 0.16 0 95 0.00 0 103 0.16 9600 0 39 0.00 0 45 ?.93 0 47 0.00 0 51 0.16 19200 0 19 0.00 0 22 ?.93 0 23 0.00 0 25 0.16 31250 0 11 2.40 0 13 0.00 0 14 ?.70 0 15 0.00 38400 0 9 0.00 0 11 0.00 0 12 0.16
367 table 13.3 bit rates and brr settings in asynchronous mode (cont) (mhz) 17.2032 18 19.6608 20 bit rate (bits/s) n n error (%) n n error (%) n n error (%) n n error (%) 110 3 75 0.48 3 79 ?.12 3 86 0.31 3 88 ?.25 150 2 223 0.00 2 233 0.16 2 255 0.00 3 64 0.16 300 2 111 0.00 2 116 0.16 2 127 0.00 2 129 0.16 600 1 223 0.00 1 233 0.16 1 255 0.00 2 64 0.16 1200 1 111 0.00 1 116 0.16 1 127 0.00 1 129 0.16 2400 0 223 0.00 0 233 0.16 0 255 0.00 1 64 0.16 4800 0 111 0.00 0 116 0.16 0 127 0.00 0 129 0.16 9600 0 55 0.00 0 58 ?.69 0 63 0.00 0 64 0.16 19200 0 27 0.00 0 28 1.02 0 31 0.00 0 32 ?.36 31250 0 16 1.20 0 17 0.00 0 19 ?.70 0 19 0.00 38400 0 13 0.00 0 14 ?.34 0 15 0.00 0 15 1.73 note: settings with an error of 1% or less are recommended.
368 table 13.4 bit rates and brr settings in synchronous mode (mhz) bit rate 24 8101620 (bits/s) n n n n n n n n n n n n 110 3 70 250 2 124 2 249 3 124 3 249 500 1 249 2 124 2 249 3 124 1k 1 124 1 249 2 124 2 249 2.5k 0 199 1 99 1 199 1 249 2 99 2 124 5k 0 99 0 199 1 99 1 124 1 199 1 249 10k 0 49 0 99 0 199 0 249 1 99 1 124 25k 0 19 0 39 0 79 0 99 0 159 0 199 50k 0 9 0 19 0 39 0 49 0 79 0 99 100k 0 4 0 9 0 19 0 24 0 39 0 49 250k 0 1 0 3 0 7 0 9 0 15 0 19 500k 0 0 * 0 10 30 4 0709 1m 0 0 * 0 10304 2.5m 0 0 * 0 1 5m 0 0 * blank: no setting available ? setting possible, but error occurs * : continuous transmission/reception not possible the brr setting is calculated as follows: asynchronous mode n = [ /(64 2 2n ?1 b)] 10 6 ?1 synchronous mode n = [ /(8 2 2n ?1 b)] 10 6 ?1 b: bit rate (bits/s) n: brr setting for baud rate generator (0 n 255) : frequency (mhz) n: baud rate generator clock source (n = 0, 1, 2, 3) for the clock sources and values of n, see following table.
369 smr settings n clock source cks1 cks0 0 00 1 /4 0 1 2 /16 1 0 3 /64 1 1 the bit rate error for asynchronous mode is given by the following formula: error (%) = {( 10 6 )/[(n + 1) b 64 2 2n ?1 ] ?1 } 100
370 table 13.5 indicates the maximum bit rates in asynchronous mode when the baud rate generator is used. tables 13.6 and 13.7 show the maximum rates for external clock input. table 13.5 maximum bit rates for various frequencies with baud rate generator (asynchronous mode) settings (mhz) maximum bit rate (bits/s) n n 2 62500 0 0 2.097152 65536 0 0 2.4576 76800 0 0 3 93750 0 0 3.6864 115200 0 0 4 125000 0 0 4.9152 153600 0 0 5 156250 0 0 6 187500 0 0 6.144 192000 0 0 7.3728 230400 0 0 8 250000 0 0 9.8304 307200 0 0 10 312500 0 0 12 375000 0 0 12.288 384000 0 0 14 437500 0 0 14.7456 460800 0 0 16 500000 0 0 17.2032 537600 0 0 18 562500 0 0 19.6608 614400 0 0 20 625000 0 0
371 table 13.6 maximum bit rates with external clock input (asynchronous mode) (mhz) external input clock (mhz) maximum bit rate (bits/s) 2 0.5000 31250 2.097152 0.5243 32768 2.4576 0.6144 38400 3 0.7500 46875 3.6864 0.9216 57600 4 1.0000 62500 4.9152 1.2288 76800 5 1.2500 78125 6 1.5000 93750 6.144 1.5360 96000 7.3728 1.8432 115200 8 2.0000 125000 9.8304 2.4576 153600 10 2.5000 156250 12 3.0000 187500 12.288 3.0720 192000 14 3.5000 218750 14.7456 3.6834 230400 16 4.0000 250000 17.2032 4.3008 268800 18 4.5000 281250 19.6608 4.9152 307200 20 5.0000 312500
372 table 13.7 maximum bit rates with external clock input (synchronous mode) (mhz) external input clock (mhz) maximum bit rate (bits/s) 2 0.3333 333333.3 4 0.6667 666666.7 6 1.0000 1000000.0 8 1.3333 1333333.3 10 1.6667 1666666.7 12 2.0000 2000000.0 14 2.3333 2333333.3 16 2.6667 2666666.7 18 3.0000 3000000.0 20 3.3333 3333333.3 13.3 operation 13.3.1 overview the sci has an asynchronous mode in which characters are synchronized individually, and a synchronous mode in which communication is synchronized with clock pulses. serial communication is possible in either mode. asynchronous/synchronous mode and the communication format are selected in the serial mode register (smr), as shown in table 13.8. the sci clock source is selected by the c/ a bit in the serial mode register (smr) and the cke1 and cke0 bits in the serial control register (scr), as shown in table 13.9. asynchronous mode: ? data length is selectable: seven or eight bits. ? parity and multiprocessor bits are selectable, and so is the stop bit length (one or two bits). the preceding selections constitute the communication format and character length. ? in receiving, it is possible to detect framing errors (fer), parity errors (per), overrun errors (orer), and the break state. ? an internal or external clock can be selected as the sci clock source. ? when an internal clock is selected, the sci operates using the on-chip baud rate generator, and can output a serial clock signal with a frequency matching the bit rate. ? when an external clock is selected, the external clock input must have a frequency 16 times the bit rate. (the on-chip baud rate generator is not used.)
373 synchronous mode: ? the communication format has a fixed eight-bit data length. ? in receiving, it is possible to detect overrun errors (orer). ? an internal or external clock can be selected as the sci clock source. ? when an internal clock is selected, the sci operates using the on-chip baud rate generator, and outputs a serial clock signal to external devices. ? when an external clock is selected, the sci operates on the input serial clock. the on-chip baud rate generator is not used. table 13.8 serial mode register settings and sci communication formats smr settings sci communication format mode bit 7: c/a bit 6: chr bit 5: pe bit 2: mp bit 3: stop data length parity bit multipro- cessor bit stop bit length asynchronous 0 0 0 0 0 8-bit absent absent 1 bit 1 2 bits 1 0 present 1 bit 1 2 bits 1 0 0 7-bit absent 1 bit 1 2 bits 1 0 present 1 bit 1 2 bits 0 * 1 0 8-bit absent present 1 bit * 1 2 bits 1 * 0 7-bit 1 bit * 1 2 bits synchronous 1 *** * 8-bit absent none note: asterisks ( * ) in the table indicate don?-care bits. asynchronous (multiprocessor format)
374 table 13.9 smr and scr settings and sci clock source selection smr scr settings sci transmit/receive clock mode bit 7: c/ a bit 1: cke1 bit 0: cke0 clock source sck pin function * asynchronous 0 0 0 internal sci does not use the sck pin mode 1 outputs a clock with frequency matching the bit rate 1 0 external inputs a clock with frequency 16 times the bit rate 1 synchronous 1 0 0 internal outputs the serial clock mode 1 1 0 external inputs the serial clock 1 note: * select the function in combination with the pin function controller (pfc). 13.3.2 operation in asynchronous mode in asynchronous mode, each transmitted or received character begins with a start bit and ends with a stop bit. serial communication is synchronized one character at a time. the transmitting and receiving sections of the sci are independent, so full duplex communication is possible. the transmitter and receiver are both double buffered, so data can be written and read while transmitting and receiving are in progress, enabling continuous transmitting and receiving. figure 13.2 shows the general format of asynchronous serial communication. in asynchronous serial communication, the communication line is normally held in the mark (high) state. the sci monitors the line and starts serial communication when the line goes to the space (low) state, indicating a start bit. one serial character consists of a start bit (low), data (lsb first), parity bit (high or low), and stop bit (high), in that order. when receiving in asynchronous mode, the sci synchronizes on the falling edge of the start bit. the sci samples each data bit on the eighth pulse of a clock with a frequency 16 times the bit rate. receive data is latched at the center of each bit.
375 0d 0 d 1 d 2 d 3 d 4 d 5 d 6 d 7 1 1 0/1 1 1 (lsb) (msb) serial data start bit 1 bit transmit/receive data 7 or 8 bits one unit of communication (character or frame) idle (mark) state parity bit stop bit 1 or no bit 1 or 2 bits figure 13.2 data format in asynchronous communication (example: 8-bit data with parity and two stop bits)
376 transmit/receive formats: table 13.10 shows the 12 communication formats that can be selected in asynchronous mode. the format is selected by settings in the serial mode register (smr). table 13.10 serial communication formats (asynchronous mode) smr bits chr pe mp stop 1 2345678 9 10 11 12 0 0 0 0 start 8-bit data stop 0 0 0 1 start 8-bit data stop stop 0 1 0 0 start 8-bit data p stop 0 1 0 1 start 8-bit data p stop stop 1 0 0 0 start 7-bit data stop 1 0 0 1 start 7-bit data stop stop 1 1 0 0 start 7-bit data p stop 1 1 0 1 start 7-bit data p stop stop 0 1 0 start 8-bit data mpb stop 0 1 1 start 8-bit data mpb stop stop 1 1 0 start 7-bit data mpb stop 1 1 1 start 7-bit data mpb stop stop : don t care bits. notes: start: start bit stop: stop bit p: parity bit mpb: multiprocessor bit clock: an internal clock generated by the on-chip baud rate generator or an external clock input from the sck pin can be selected as the sci transmit/receive clock. the clock source is selected by the c/ a bit in the serial mode register (smr) and bits cke1 and cke0 in the serial control register (scr) (table 13.9). when an external clock is input at the sck pin, it must have a frequency equal to 16 times the desired bit rate.
377 when the sci operates on an internal clock, it can output a clock signal at the sck pin. the frequency of this output clock is equal to the bit rate. the phase is aligned as in figure 13.3 so that the rising edge of the clock occurs at the center of each transmit data bit. 0 d0d1d2d3d4d5d6d70/1 1 1 1 frame figure 13.3 phase relationship between output clock and serial data (asynchronous mode) transmitting and receiving data (sci initialization (asynchronous mode)): before transmitting or receiving, software must clear the te and re bits to 0 in the serial control register (scr), then initialize the sci as follows. when changing the communication mode or format, always clear the te and re bits to 0 before following the procedure given below. clearing te to 0 sets tdre to 1 and initializes the transmit shift register (tsr). clearing re to 0, however, does not initialize the rdrf, per, fer, and orer flags and receive data register (rdr), which retain their previous contents. when an external clock is used, the clock should not be stopped during initialization or subsequent operation. sci operation becomes unreliable if the clock is stopped. figure 13.4 shows a sample flowchart for initializing the sci. the procedure for initializing the sci is as follows: 1. select the communication format in the serial mode register (smr). 2. write the value corresponding to the bit rate in the bit rate register (brr) unless an external clock is used. 3. select the clock source in the serial control register (scr). leave rie, tie, teie, mpie, te, and re cleared to 0. if clock output is selected in asynchronous mode, clock output starts immediately after the setting is made in scr. 4. wait for at least the interval required to transmit or receive one bit, then set te or re in the serial control register (scr) to 1. also set rie, tie, teie, and mpie as necessary. setting te or re enables the sci to use the txd or rxd pin. the initial states are the mark transmit state, and the idle receive state (waiting for a start bit).
378 start of initialization clear te and re bits to 0 in scr select communication format in smr set value in brr set cke1 and cke0 bits in scr (leaving te and re cleared to 0) wait set te or re to 1 in scr; set rie, tie, teie, and mpie as necessary 1-bit interval elapsed? end (1) (2) (3) (4) no yes figure 13.4 sample flowchart for sci initialization transmitting serial data (asynchronous mode): figure 13.5 shows a sample flowchart for transmitting serial data. the procedure for transmitting serial data is as follows: 1. sci initialization: select the txd pin function with the pfc. 2. sci status check and transmit data write: read the serial status register (ssr), check that the tdre bit is 1, then write transmit data in the transmit data register (tdr) and clear tdre to 0. 3. to continue transmitting serial data: read the tdre bit to check whether it is safe to write (1); if so, write data in tdr, then clear tdre to 0. when the dmac is started by a transmit-data- empty interrupt request (txi) to write data in tdr, the tdre bit is checked and cleared automatically. 4. to output a break signal at the end of serial transmission: set the dr bit to 0, then clear te to 0 in scr and set the txd pin function as output port with the pfc.
379 start transmitting initialize read tdre bit in ssr read tend bit in ssr clear te bit of scr to 0; select thetxd pin function as an output port with the pfc tend = 1? transmission ends (1) (2) (3) no yes tdre = 1? write transmit data in tdr and clear tdre bit to 0 in ssr all data transmitted? no yes output break signal? no yes set dr = 0 (4) yes no figure 13.5 sample flowchart for transmitting serial data
380 in transmitting serial data, the sci operates as follows: 1. the sci monitors the tdre bit in ssr. when tdre is cleared to 0, the sci recognizes that the transmit data register (tdr) contains new data, and loads this data from tdr into the transmit shift register (tsr). 2. after loading the data from tdr into tsr, the sci sets the tdre bit to 1 and starts transmitting. if the transmit-data-empty interrupt enable bit (tie) is set to 1 in scr, the sci requests a transmit-data-empty interrupt (txi) at this time. serial transmit data is transmitted in the following order from the txd pin: 1. start bit: one 0 bit is output. 2. transmit data: seven or eight bits of data are output, lsb first. 3. parity bit or multiprocessor bit: one parity bit (even or odd parity) or one multiprocessor bit is output. formats in which neither a parity bit nor a multiprocessor bit is output can also be selected. 4. stop bit: one or two 1-bits (stop bits) are output. 5. mark state: output of 1-bits continues until the start bit of the next transmit data. 6. the sci checks the tdre bit when it outputs the stop bit. if tdre is 0, the sci loads new data from tdr into tsr, outputs the stop bit, then begins serial transmission of the next frame. if tdre is 1, the sci sets the tend bit to 1 in ssr, outputs the stop bit, then continues output of 1-bits in the mark state. if the transmit-end interrupt enable bit (teie) in scr is set to 1, a transmit-end interrupt (tei) is requested. figure 13.6 shows an example of sci transmit operation in asynchronous mode.
381 01 1 1 0/1 0 1 tdre tend parity bit parity bit serial data start bit data stop bit start bit data stop bit idle (mark) state txi request txi interrupt handler writes data in tdr and clears tdre to 0 txi request tei request 1 frame d 0 d 1 d 7 d 0 d 1 d 7 0/1 figure 13.6 example of sci transmit operation in asynchronous mode (8-bit data with parity and one stop bit) receiving serial data (asynchronous mode): figure 13.7 shows a sample flowchart for receiving serial data. the procedure for receiving serial data is listed below. 1. sci initialization: select the rxd pin function with the pfc. 2. receive error handling and break detection: if a receive error occurs, read the orer, per and fer bits in ssr to identify the error. after executing the necessary error handling, clear orer, per, and fer all to 0. receiving cannot resume if orer, per, or fer remains set to 1. when a framing error occurs, the rxd pin can be read to detect the break state. 3. sci status check and receive data read: read the serial status register (sr), check that rdrf is set to 1, then read receive data from the receive data register (rdr) and clear rdrf to 0. the rxi interrupt can also be used to determine if the rdrf bit has changed from 0 to 1. 4. to continue receiving serial data: read rdrf and rdr, and clear rdrf to 0 before the stop bit of the current frame is received. if the dmac is started by a receive-data-full interrupt (rxi) to read rdr, the rdrf bit is cleared automatically, so this step is unnecessary.
382 start receiving initialization read the orer, per, and fer bits in ssr total count received? reception ends (1) no yes per, fer, orer = 1? rdrf = 1? yes yes clear the re bit in scr to 0 no no read the rdrf bit in ssr error handling (3) (2) read the rdr's receive data and clear the rdrf bit in ssr to 0 (4) figure 13.7 sample flowchart for receiving serial data
383 start of error handling orer = 1? overrun error handling fer = 1? yes break? no framing error handling per = 1? yes parity error handling clear orer, per, and fer to 0 in ssr end clear re bit to 0 in scr no no no yes yes figure 13.7 sample flowchart for receiving serial data (cont)
384 in receiving, the sci operates as follows: 1. the sci monitors the receive data line. when it detects a start bit (0), the sci synchronizes internally and starts receiving. 2. receive data is shifted into rsr in order from the lsb to the msb. 3. the parity bit and stop bit are received. after receiving these bits, the sci makes the following checks: a. parity check: the number of 1s in the receive data must match the even or odd parity setting of the o/ e bit in smr. b. stop bit check: the stop bit value must be 1. if there are two stop bits, only the first stop bit is checked. c. status check: rdrf must be 0 so that receive data can be loaded from rsr into rdr. if these checks all pass, the sci sets rdrf to 1 and stores the received data in rdr. if one of the checks fails (receive error), the sci operates as indicated in table 13.11. note: when a receive error flag is set, further receiving is disabled. the rdrf bit is not set to 1. be sure to clear the error flags. 4. after setting rdrf to 1, if the receive-data-full interrupt enable bit (rie) is set to 1 in scr, the sci requests a receive-data-full interrupt (rxi). if one of the error flags (orer, per, or fer) is set to 1 and the receive-data-full interrupt enable bit (rie) in scr is also set to 1, the sci requests a receive-error interrupt (eri). figure 13.8 shows an example of sci receive operation in asynchronous mode. table 13.11 receive error conditions and sci operation receive error abbreviation condition data transfer overrun error orer receiving of next data ends while rdrf is still set to 1 in ssr receive data not loaded from rsr into rdr framing error fer stop bit is 0 receive data loaded from rsr into rdr parity error per parity of receive data differs from even/odd parity setting in smr receive data loaded from rsr into rdr
385 tdre fer framing error, eri request 1 frame rxi interrupt handler reads data in rdr and clears rdrf to 0 rxi request 01 1 1 0/1 0 0 parity bit parity bit serial data start bit data stop bit start bit data stop bit idle (mark) state d 0 d 1 d 7 d 0 d 1 d 7 0/1 figure 13.8 example of sci receive operation (8-bit data with parity and one stop bit) 13.3.3 multiprocessor communication the multiprocessor communication function enables several processors to share a single serial communication line. the processors communicate in asynchronous mode using a format with an additional multiprocessor bit (multiprocessor format). in multiprocessor communication, each receiving processor is addressed by a unique id. a serial communication cycle consists of an id-sending cycle that identifies the receiving processor, and a data-sending cycle. the multiprocessor bit distinguishes id-sending cycles from data-sending cycles. the transmitting processor starts by sending the id of the receiving processor with which it wants to communicate as data with the multiprocessor bit set to 1. next the transmitting processor sends transmit data with the multiprocessor bit cleared to 0. receiving processors skip incoming data until they receive data with the multiprocessor bit set to 1. when they receive data with the multiprocessor bit set to 1, receiving processors compare the data with their ids. the receiving processor with a matching id continues to receive further incoming data. processors with ids not matching the received data skip further incoming data until they again receive data with the multiprocessor bit set to 1. multiple processors can send and receive data in this way. figure 13.9 shows an example of communication between processors using the multiprocessor format.
386 receiving processor a (id = 01) (id = 02) (id = 03) (id = 04) receiving processor b receiving processor c serial communication line h'01 h'aa (mpb = 0) (mpb = 1) id-sending cycle: receiving processor address serial data transmitting processor receiving processor d data-sending cycle: data sent to receiving processor specified by id mpb: multiprocessor bit figure 13.9 example of communication between processors using multiprocessor format (sending data h'aa to receiving processor a) communication formats: four formats are available. parity-bit settings are ignored when a multiprocessor format is selected. for details see table 13.8. clock: see the description in the asynchronous mode section. transmitting multiprocessor serial data: figure 13.10 shows a sample flowchart for transmitting multiprocessor serial data. the procedure for transmitting multiprocessor serial data is listed below. 1. sci initialization: select the txd pin function with the pfc. 2. sci status check and transmit data write: read the serial status register (ssr), check that the tdre bit is 1, then write transmit data in the transmit data register (tdr). also set mpbt (multiprocessor bit transfer) to 0 or 1 in ssr. finally, clear tdre to 0. 3. to continue transmitting serial data: read the tdre bit to check whether it is safe to write (1); if so, write data in tdr, then clear tdre to 0. when the dmac is started by a transmit-data- empty interrupt request (txi) to write data in tdr, the tdre bit is checked and cleared automatically. 4. to output a break signal at the end of serial transmission: set the dr bit to 0 (i/o data port register), then clear te to 0 in scr and set the txd pin function as output port with the pfc.
387 tdre = 1? write transmit data in tdr and set mpbt in ssr all data transmitted? yes tend = 1? read tend bit in ssr output break signal? yes set dr = 0 clear te bit to 0 in scr; select thetxd pin function as an output port with the pfc end yes read tdre bit in ssr clear tdre bit to 0 initialize no no yes no no (1) (2) (3) (4) start transmitting figure 13.10 sample flowchart for transmitting multiprocessor serial data
388 in transmitting serial data, the sci operates as follows: 1. the sci monitors the tdre bit in ssr. when tdre is cleared to 0 the sci recognizes that the transmit data register (tdr) contains new data, and loads this data from tdr into the transmit shift register (tsr). 2. after loading the data from tdr into tsr, the sci sets the tdre bit to 1 and starts transmitting. if the transmit-data-empty interrupt enable bit (tie) in scr is set to 1, the sci requests a transmit-data-empty interrupt (txi) at this time. serial transmit data is transmitted in the following order from the txd pin (figure 13.11): a. start bit: one 0 bit is output. b. transmit data: seven or eight bits are output, lsb first. c. multiprocessor bit: one multiprocessor bit (mpbt value) is output. d. stop bit: one or two 1-bits (stop bits) are output. e. mark state: output of 1-bits continues until the start bit of the next transmit data. 3. the sci checks the tdre bit when it outputs the stop bit. if tdre is 0, the sci loads data from tdr into tsr, outputs the stop bit, then begins serial transmission of the next frame. if tdre is 1, the sci sets the tend bit in ssr to 1, outputs the stop bit, then continues output of 1-bits in the mark state. if the transmit-end interrupt enable bit (teie) in scr is set to 1, a transmit-end interrupt (tei) is requested at this time. tdre tend txi request txi interrupt handler writes data in tdr and clears tdre to 0 txi request tei request 1 frame 01 1 1 0/1 0 1 multi- processor bit serial data start bit data stop bit start bit data stop bit idle (mark) state d 0 d 1 d 7 d 0 d 1 d 7 0/1 multi- processor bit figure 13.11 example of sci multiprocessor transmit operation (8-bit data with multiprocessor bit and one stop bit)
389 receiving multiprocessor serial data: figure 13.12 shows a sample flowchart for receiving multiprocessor serial data. the procedure for receiving multiprocessor serial data is listed below. 1. sci initialization: select the rxd pin function with the pfc. 2. id receive cycle: set the mpie bit in the serial control register (scr) to 1. 3. sci status check and compare to id reception: read the serial status register (ssr), check that rdrf is set to 1, then read data from the receive data register (rdr) and compare with the processor's own id. if the id does not match the receive data, set mpie to 1 again and clear rdrf to 0. if the id matches the receive data, clear rdrf to 0. 4. receive error handling and break detection: if a receive error occurs, read the orer and fer bits in ssr to identify the error. after executing the necessary error handling, clear both orer and fer to 0. receiving cannot resume if orer or fer remain set to 1. when a framing error occurs, the rxd pin can be read to detect the break state. 5. sci status check and data receiving: read ssr, check that rdrf is set to 1, then read data from the receive data register (rdr).
390 rdrf = 1? fer = 1 or orer = 1? rdrf = 1? total count received? no reception ends yes set the mpie bit in scr to 1 read the rdrf bit in ssr initialization clear the re bit in scr to 0 no no (1) (2) read the orer and fer bits in ssr fer = 1 or orer = 1? read the rdrf bit in ssr read the receive data in rdr own id? yes read the orer and fer bits in ssr (3) no error handling yes yes (4) yes no start receiving no yes read the receive data in rdr (5) figure 13.12 sample flowchart for receiving multiprocessor serial data
391 orer = 1? break? yes framing error handling yes start of error handling overrun error handling yes fer = 1? clear orer and fer to 0 in ssr end no no no clear re bit to 0 in scr figure 13.12 sample flowchart for receiving multiprocessor serial data (cont)
392 figure 13.13 shows an example of sci receive operation using a multiprocessor format. rdrf mpie rdr value id1 rxi request, (multiprocessor interrupt) mpie = 0 rxi interrupt handler reads data in rdr and clears rdrf to 0 not own id, so mpie is set to 1 again no rxi interrupt, rdr maintains state 01 1 1 10 1 mpb mpb serial data start bit data id1 stop bit start bit data 1 stop bit idle (mark) state d 0 d 1 d 7 d 0 d 1 d 7 0 mpb figure 13.13 example of sci receive operation (own id does not match data) (8-bit data with multiprocessor bit and one stop bit)
393 rdrf mpie rdr value id1 id2 data2 01 1 1 10 1 mpb mpb serial data start bit data id2 stop bit start bit data 2 stop bit idle (mark) state d 0 d 1 d 7 d 0 d 1 d 7 0 rxi request, (multiprocessor interrupt) mpie = 0 rxi interrupt handler reads data in rdr and clears rdrf to 0 own id, so receving continues, with data received at each rxi mpie bit is again set to 1 mpb figure 13.13 example of sci receive operation (own id matches data) (8-bit data with multiprocessor bit and one stop bit) (cont) 13.3.4 synchronous operation in synchronous mode, the sci transmits and receives data in synchronization with clock pulses. this mode is suitable for high-speed serial communication. the sci transmitter and receiver share the same clock but are otherwise independent, so full duplex communication is possible. the transmitter and receiver are also double buffered, so continuous transmitting or receiving is possible by reading or writing data while transmitting or receiving is in progress. figure 13.14 shows the general format in synchronous serial communication.
394 bit 0 bit 1 bit 2 bit 3 bit 4 bit 5 bit 6 bit 7 lsb msb serial clock serial data * * transfer direction one unit (character or frame) of serial data note: * high except in continuous transmitting or receiving. figure 13.14 data format in synchronous communication in synchronous serial communication, each data bit is output on the communication line from one falling edge of the serial clock to the next. data is guaranteed valid at the rising edge of the serial clock. in each character, the serial data bits are transmitted in order from the lsb (first) to the msb (last). after output of the msb, the communication line remains in the state of the msb. in synchronous mode, the sci transmits or receives data by synchronizing with the falling edge of the serial clock. communication format: the data length is fixed at eight bits. no parity bit or multiprocessor bit can be added. clock: an internal clock generated by the on-chip baud rate generator or an external clock input from the sck pin can be selected as the sci transmit/receive clock. the clock source is selected by the c/ a bit in the serial mode register (smr) and bits cke1 and cke0 in the serial control register (scr). see table 13.6. when the sci operates on an internal clock, it outputs the clock signal at the sck pin. eight clock pulses are output per transmitted or received character. when the sci is not transmitting or receiving, the clock signal remains in the high state. figure 13.15 shows an example of sci transmit operation. in transmitting serial data, the sci operates as follows. 1. the sci monitors the tdre bit in ssr. when tdre is cleared to 0 the sci recognizes that the transmit data register (tdr) contains new data, and loads this data from tdr into the transmit shift register (tsr). 2. after loading the data from tdr into tsr, the sci sets the tdre bit to 1 and starts transmitting. if the transmit-data-empty interrupt enable bit (tie) in scr is set to 1, the sci requests a transmit-data-empty interrupt (txi) at this time.
395 if clock output is selected, the sci outputs eight serial clock pulses. if an external clock source is selected, the sci outputs data in synchronization with the input clock. data is output from the txd pin in order from the lsb (bit 0) to the msb (bit 7). 3. the sci checks the tdre bit when it outputs the msb (bit 7). if tdre is 0, the sci loads data from tdr into tsr, transmits the msb, then begins serial transmission of the next frame. if tdre is 1, the sci sets the tend bit in ssr to 1, transmits the msb, then holds the transmit data pin (txd) in the msb state. if the transmit-end interrupt enable bit (teie) in scr is set to 1, a transmit-end interrupt (tei) is requested at this time. 4. after the end of serial transmission, the sck pin is held in the high state. bit 0 bit 1 bit 7 bit 0 bit 1 bit 6 serial clock serial data transmit direction bit 7 txi interrupt handler writes data in tdr and clears tdre to 0 1 frame txi request txi request tdre tend lsb msb tei request figure 13.15 example of sci transmit operation transmitting and receiving data: sci initialization (synchronous mode): before transmitting or receiving, software must clear the te and re bits to 0 in the serial control register (scr), then initialize the sci as follows. when changing the communication mode or format, always clear the te and re bits to 0 before following the procedure given below. clearing te to 0 sets tdre to 1 and initializes the transmit shift register (tsr). clearing re to 0, however, does not initialize the rdrf, per, fer, and orer flags and receive data register (rdr), which retain their previous contents. figure 13.16 shows a sample flowchart for initializing the sci.
396 1. select the communication format in the serial mode register (smr). 2. write the value corresponding to the bit rate in the bit rate register (brr) unless an external clock is used. 3. select the clock source in the serial control register (scr). leave rie, tie, teie, mpie, te, and re cleared to 0. 4. wait for at least the interval required to transmit or receive one bit, then set te or re in the serial control register (scr) to 1. also set rie, tie, teie, and mpie. setting the corresponding bit of the pin function controller, te, and re enables the sci to use the txd or rxd pin. start of initialization clear te and re bits to 0 in scr (3) 1-bit interval elapsed? set te or re to 1 in scr; set rie, tie, teie, and mpie select communication format in smr yes no set value in brr set rie, tie, teie, mpie, cke1, and cke0 bits in scr (leaving te and re cleared to 0) end wait (1) (2) (4) figure 13.16 sample flowchart for sci initialization
397 transmitting serial data (synchronous mode): figure 13.17 shows a sample flowchart for transmitting serial data. the procedure for transmitting serial data is listed below. 1. sci initialization: select the txd pin function with the pfc. 2. sci status check and transmit data write: read the serial status register (ssr), check that the tdre bit is 1, then write transmit data in the transmit data register (tdr) and clear tdre to 0. 3. to continue transmitting serial data: read the tdre bit to check whether it is safe to write (1); if so, write data in tdr, then clear tdre to 0. when the dmac is started by a transmit-data- empty interrupt request (txi) to write data in tdr, the tdre bit is checked and cleared automatically. start transmitting read tdre bit in ssr all data transmitted? yes no transmission ends (1) (2) (3) initialize tdre = 1? write transmit data in tdr and clear tdre bit to 0 in ssr yes no read tend bit in ssr tend = 1? yes no clear te bit scr to 0 figure 13.17 sample flowchart for serial transmitting
398 receiving serial data (synchronous mode): figure 13.18 shows a sample flowchart for receiving serial data. when switching from asynchronous mode to synchronous mode, make sure that orer, per, and fer are cleared to 0. if per or fer is set to 1, the rdrf bit will not be set and both transmitting and receiving will be disabled. figure 13.19 shows an example of sci receive operation. the procedure for receiving serial data is listed below. 1. sci initialization: select the rxd pin function with the pfc. 2. receive error handling and break detection: if a receive error occurs, read the orer bit in ssr to identify the error. after executing the necessary error handling, clear orer to 0. transmitting/receiving cannot resume if orer remains set to 1. 3. sci status check and receive data read: read the serial status register (ssr), check that rdrf is set to 1, then read receive data from the receive data register (rdr) and clear rdrf to 0. the rxi interrupt can also be used to determine if the rdrf bit has changed from 0 to 1. 4. to continue receiving serial data: read rdr, and clear rdrf to 0 before the frame msb (bit 7) of the current frame is received. if the dmac is started by a receive-data-full interrupt (rxi) to read rdr, the rdrf bit is cleared automatically, so this step is unnecessary.
399 start receiving initialization read orer bit in ssr total count received? reception ends (1) no yes orer = 1? rdrf = 1? yes clear re bit in scr to 0 no no read rdrf bit in ssr (3) yes error handling (2) read receive data in rdr and clear rdrf bit in ssr to 0 (4) figure 13.18 sample flowchart for serial receiving
400 error handling end orer = 1? no clear orer bit in ssr to 0 yes overrun error handling figure 13.18 sample flowchart for serial receiving (cont) bit 7 bit 0 bit 7 bit 0 bit 1 bit 6 serial clock serial data receive direction bit 7 rxi interrupt handler reads data in rdr and clears rdrf to 0 1 frame rxi request rxi request overrun error, eri request rdrf orer figure 13.19 example of sci receive operation in receiving, the sci operates as follows: 1. the sci synchronizes with serial clock input or output and initializes internally. 2. receive data is shifted into rsr in order from the lsb to the msb. after receiving the data, the sci checks that rdrf is 0 so that receive data can be loaded from rsr into rdr. if this check passes, the sci sets rdrf to 1 and stores the received data in rdr. if the check does not pass (receive error), the sci operates as indicated in table 13.8. when the error flag is set
401 to 1 and the rdrf bit is cleared to 0, the rdrf bit will not be set to 1 during reception. when restarting reception, be sure to clear the error flag to 0. 3. after setting rdrf to 1, if the receive-data-full interrupt enable bit (rie) is set to 1 in scr, the sci requests a receive-data-full interrupt (rxi). if the orer bit is set to 1 and the receive- data-full interrupt enable bit (rie) in scr is also set to 1, the sci requests a receive-error interrupt (eri). transmitting and receiving serial data simultaneously (synchronous mode): figure 13.20 shows a sample flowchart for transmitting and receiving serial data simultaneously. the procedure for transmitting and receiving serial data simultaneously is listed below. 1. sci initialization: select the txd and rxd pin function with the pfc. 2. sci status check and transmit data write: read the serial status register (ssr), check that the tdre bit is 1, then write transmit data in the transmit data register (tdr) and clear tdre to 0. the txi interrupt can also be used to determine if the tdre bit has changed from 0 to 1. 3. receive error handling: if a receive error occurs, read the orer bit in ssr to identify the error. after executing the necessary error handling, clear orer to 0. transmitting/receiving cannot resume if orer remains set to 1. 4. sci status check and receive data read: read the serial status register (ssr), check that rdrf is set to 1, then read receive data from the receive data register (rdr) and clear rdrf to 0. the rxi interrupt can also be used to determine if the rdrf bit has changed from 0 to 1. 5. to continue transmitting and receiving serial data: read the rdrf bit and rdr, and clear rdrf to 0 before the msb (bit 7) of the current frame is received. also read the tdre bit to check whether it is safe to write (1); if so, write data in tdr, then clear tdre to 0 before the msb (bit 7) of the current frame is transmitted. when the dmac is started by a transmit-data- empty interrupt request (txi) to write data in tdr, the tdre bit is checked and cleared automatically. when the dmac is started by a receive-data-full interrupt (rxi) to read rdr, the rdrf bit is cleared automatically.
402 start transmitting and receiving initialization read tdre bit in ssr total count transmitted and received? transmitting/receiving ends (1) (2) no yes tdre = 1? write transmit data to tdr and clear tdre bit in ssr to 0 rdrf = 1? no yes yes no read orer bit in ssr error handling (3) orer = 1? no read rdrf bit in ssr (5) yes (4) read receive data in rdr and clear rdrf bit in ssr to 0 clear te and re bits in scr to 0 note: when switching from transmitting or receiving to simultaneous transmitting and receiving, clear both the te bit and the re bit to 0, then set both this to 1 simultaneously. figure 13.20 sample flowchart for serial transmitting and receiving
403 13.4 sci interrupt sources and the dmac the sci has four interrupt sources in each channel: transmit-end (tei), receive-error (eri), receive-data-full (rxi), and transmit-data-empty (txi). table 13.12 lists the interrupt sources and indicates their priority. these interrupts can be enabled and disabled by the tie, rie, and teie bits in the serial control register (scr). each interrupt request is sent separately to the interrupt controller. txi is requested when the tdre bit in ssr is set to 1. txi can start the direct memory access controller (dmac) to transfer data. tdre is automatically cleared to 0 when the dmac executes a data transfer to the transmit data register (tdr). rxi is requested when the rdrf bit in ssr is set to 1. rxi can start the dmac to transfer data. rdrf is automatically cleared to 0 when the dmac executes a data transfer to the receive data register (rdr). eri is requested when the orer, per, or fer bit in ssr is set to 1. eri cannot start the dmac. tei is requested when the tend bit in ssr is set to 1. tei cannot start the dmac. a txi interrupt indicates that transmit data writing is enabled. a tei interrupt indicates that the transmit operation is complete. table 13.12 sci interrupt sources interrupt source description dmac activation priority eri receive error (orer, per, or fer) no high rxi receive data full (rdrf) yes 13.5 usage notes note the following points when using the sci. tdr write and tdre flags: the tdre bit in the serial status register (ssr) is a status flag indicating loading of transmit data from tdr into tsr. the sci sets tdre to 1 when it transfers data from tdr to tsr. data can be written in tdr regardless of the status of the tdre bit. if new data is written in tdr when tdre is 0, the old data stored in tdr will be lost because this data has not yet been transferred to tsr. before writing transmit data to tdr, be sure to check that tdre is set to 1. simultaneous multiple receive errors: table 13.13 indicates the state of the ssr status flags when multiple receive errors occur simultaneously. when an overrun error occurs, the rsr contents cannot be transferred to rdr, so receive data is lost.
404 table 13.13 ssr status flags and transfer of receive data ssr status flags receive data transfer receive error status rdrf orer fer per rsr rdr overrun error 1 1 0 0 x framing error 0 0 1 0 o parity error 0 0 0 1 o overrun error + framing error 1 1 1 0 x overrun error + parity error 1 1 0 1 x framing error + parity error 0 0 1 1 o overrun error + framing error + parity error 1111x o: receive data is transferred from rsr to rdr. x: receive data is not transferred from rsr to rdr. break detection and processing: break signals can be detected by reading the rxd pin directly when a framing error (fer) is detected. in the break state, the input from the rxd pin consists of all 0s, so fer is set and the parity error flag (per) may also be set. in the break state, the sci receiver continues to operate, so if the fer bit is cleared to 0, it will be set to 1 again. sending a break signal: when te is cleared to 0 the txd pin becomes an i/o port, the level and direction (input or output) of which are determined by the data register (dr) of the i/o port and the control register (cr) of the pfc. this feature can be used to send a break signal. the dr value substitutes for the mark state until the pfc setting is performed. the dr bits should therefore be set as an output port that outputs 1 beforehand. to send a break signal during serial transmission, clear the dr bit to 0, and select output port as the txd pin function by the pfc. when te is cleared to 0, the transmitter is initialized, regardless of its current state. receive error flags and transmitter operation (synchronous mode only): when a receive error flag (orer, per, or fer) is set to 1, the sci will not start transmitting even if tdre is set to 1. be sure to clear the receive error flags to 0 before starting to transmit. note that clearing re to 0 does not clear the receive error flags. receive data sampling timing and receive margin in asynchronous mode: in asynchronous mode, the sci operates on a base clock of 16 times the bit rate frequency. in receiving, the sci synchronizes internally with the falling edge of the start bit, which it samples on the base clock. receive data is latched on the rising edge of the eighth base clock pulse. see figure 13.21.
405 0 1 2 3 4 5 6 7 8 9 10111213 1415 0 1 2 3 4 5 6 7 8 9 10111213 1415 0 1 2 3 4 5 internal base clock receive data (rxd) synchronization sampling timing data sampling timing 8 clocks 16 clocks start bit 7.5 clocks +7.5 clocks d0 d1 figure 13.21 receive data sampling timing in asynchronous mode the receive margin in asynchronous mode can therefore be expressed as shown in equation 1. equation 1: m = 0.5 (l 0.5)f (1 + f ) 0.5 n m: receive margin (%) n: ratio of clock frequency to bit rate (n = 16) d: clock duty cycle (d = 0 to 1.0) l: frame length (l = 9 to 12) f: absolute deviation of clock frequency from equation (1), if f = 0 and d = 0.5 the receive margin is 46.875%, as given by equation 2. equation 2: d = 0.5, f = 0 m = (0.5 1/(2 this is a theoretical value. a reasonable margin to allow in system designs is 20?0%.
406 constraints on dmac use: ? when using an external clock source for the serial clock, update tdr with the dmac, and then input the transmit clock after the elapse of five system clocks or more. if a transmit clock is input in the first four system clocks after tdr is written, an error may occur (figure 13.22). ? before reading the receive data register (rdr) with the dmac, select the receive-data-full interrupt of the sci as an activation source using the resource select bit (rs) in the channel control register (chcr). d0 d1 d2 d3 d4 d5 d6 d7 sck tdre t note: during external clock operation, an error may occur if t is 4 figure 13.22 example of synchronous transmitting with dmac cautions on use of synchronous external clock mode: ? set te = re = 1 only when the external clock sci is 1. ? do not set te = re = 1 until at least 4 clocks after the external clock sck has changed from 0 to 1. ? when receiving, rdrf is set to 1 when re is cleared to 0 2.5?.5 clocks after the rising edge of the rxd d7 bit sck input, but copying to rdr is not possible. caution on synchronous internal clock mode: when receiving, rdrf is set to 1 when re is cleared to 0 1.5 clocks after the rising edge of the rxd d7 bit sck output, but copying to rdr is not possible.
407 section 14 a/d converter 14.1 overview the superh microcomputer includes an analog-to-digital converter module which can be programmed for input of analog signals up to eight channels. a/d conversion is performed by the successive approximations method with 10-bit resolution. 14.1.1 features ? 10-bit resolution ? eight analog input channels ? user definable analog conversion voltage range ? the analog conversion voltage range can be set with the analog reference power pin (avref) as the analog reference voltage ? rapid conversion time: 6.7 s per channel (at 20 mhz) ? single mode or scan mode (selectable) ? single mode: one-channel a/d conversion ? scan mode: a/d conversion repeated on one to four channels ? four 16-bit data registers: a/d conversion results are transferred to and stored in the data registers corresponding to channels ? sample-and-hold circuit ? external trigger input can start a/d conversion ? adi: a/d interrupt request ? can be generated at end of each conversion cycle ? can start direct memory access controller (dmac)
408 14.1.2 block diagram figure 14.1 shows a block diagram of the a/d converter. 10-bit d/a addra addrb addrc addrd bus interface module data bus analog multi- plexer control circuit successive approxi- mations register + comparator sample-and- hold circuit adi interrupt signal v ref av ss an0 an1 an2 an3 an4 an5 an6 an7 /8 /16 adcsr adcr av cc a/d converter internal data bus adtrg adcr: a/d control register adcsr: a/d control/status register addra: a/d data register a addrb: a/d data register b addrc: a/d data register c addrd: a/d data register d figure 14.1 block diagram of a/d converter
409 14.1.3 configuration of input pins table 14.1 lists input pins for the a/d converter. the eight analog input pins are grouped into two sets. group 0 comprises analog input pins 0? (an 0 ?n 3 ) and group 1 comprises pins 4? (an 4 an 7 ). pins av cc and av ss are the power supply pins for the analog circuits of the a/d converter. av ref is the analog reference voltage for a/d conversion. table 14.1 input pins pin name abbreviation i/o function analog supply voltage av cc i power supply for the analog circuits analog ground av ss i ground and reference voltage for the analog circuits analog reference power supply av ref i reference voltage for the analog circuits analog input 0 an0 i analog input pins, group 0 analog input 1 an1 i analog input 2 an2 i analog input 3 an3 i analog input 4 an4 i analog input pins, group 1 analog input 5 an5 i analog input 6 an6 i analog input 7 an7 i a/d conversion trigger input adtrg i a/d conversion start external trigger input
410 14.1.4 configuration of a/d registers the a/d converter includes the registers listed in table 14.2. table 14.2 a/d registers register name abbreviation r/w initial value address * 1 access size a/d data register a (high) addrah r h'00 h'05fffee0 8, 16 a/d data register a (low) addral r h'00 h'05fffee1 16 a/d data register b (high) addrbh r h'00 h'05fffee2 8, 16 a/d data register b (low) addrbl r h'00 h'05fffee3 16 a/d data register c (high) addrch r h'00 h'05fffee4 8, 16 a/d data register c (low) addrcl r h'00 h'05fffee5 16 a/d data register d (high) addrdh r h'00 h'05fffee6 8, 16 a/d data register d (low) addrdl r h'00 h'05fffee7 16 a/d control/status register adcsr r/(w) * 2 h'00 h'05fffee8 8, 16 a/d control register adcr r/w h'7f h'05fffee9 8, 16 notes: * 1 only the values of bits a27?24 and a8?0 are valid; bits a23?9 are ignored. for details on the register addresses, see section 8.3.5, area descriptions. * 2 only 0 can be written in bit 7, to clear the flag. 14.2 register descriptions 14.2.1 a/d data registers a? (addra?ddrd) the four a/d data registers (addra?ddrd) are 16-bit read-only registers that store the results of the a/d conversion. each result consists of 10 bits. the first 8 bits are stored in the upper byte of the data register corresponding to the selected channel. the last two bits are stored in the lower byte of the data register. bits 5? of the lower byte are reserved and are always read as 0. each data register is assigned to two analog input channels (table 14.3). the a/d data registers are always readable by the cpu. the upper byte can be read directly and the lower byte is read via a temporary register (temp). see section 14.3, cpu interface, for details. the a/d data registers are initialized to h'0000 by a reset and in standby mode.
411 bit: 15 14 13 12 11 10 9 8 addrn: ad9 ad8 ad7 ad6 ad5 ad4 ad3 ad2 initial value: 0 0 0 0 0 0 0 0 r/w: r r r r r r r r bit: 7 6 5 4 3 2 1 0 addrn: ad1 ad0 initial value: 0 0 0 0 0 0 0 0 r/w: r r r r r r r r n = a? table 14.3 assignment of data registers to analog input channels analog input channel group 0 group 1 a/d data register an0 an4 addra an1 an5 addrb an2 an6 addrc an3 an7 addrd 14.2.2 a/d control/status register (adcsr) the a/d control/status register (adcsr) is an 8-bit read/write register that controls the operation of the a/d converter (mode selection, etc.). adcsr is initialized to h'00 by a reset and in standby mode. bit: 7 6 5 4 3 2 1 0 bit name: adf adie adst scan cks ch2 ch1 ch0 initial value: 0 0 0 0 0 0 0 0 r/w: r/(w) * r/w r/w r/w r/w r/w r/w r/w note: * only 0 can be written, to clear the flag.
412 ? bit 7 (a/d end flag (adf)): adf indicates that a/d conversion is completed. bit 7 (adf) description 0 cleared to 0 under the following conditions: (initial value) ? the cpu reads the adf bit while the bit is set to 1, then writes 0 in the bit ? the adi starts the dmac and the a/d conversion register is accessed 1 set to 1 at the following times: ? single mode: when a/d conversion is complete ? scan mode: when a/d conversion of all selected channels is complete ? bit 6 (a/d interrupt enable (adie)): adie selects whether or not an a/d interrupt (adi) is requested when a/d conversion is completed. bit 6 (adie) description 0 the a/d interrupt (adi) request is disabled (initial value) 1 the a/d interrupt (adi) request is enabled ? bit 5 (a/d start (adst)): adst selects the start or halting of a/d conversion. whenever the a/d converter is operating, this bit is set to 1. it can also be set to 1 by the a/d conversion trigger input pin ( adtrg ). bit 5 (adst) description 0 a/d conversion is halted (initial value) 1 ? single mode: a/d conversion is performed. this bit is automatically cleared to 0 at the end of the conversion. ? scan mode: a/d conversion starts and continues cyclically on the selected channels until this bit is cleared to 0 by software, a reset, or standby mode. ? bit 4 (scan mode (scan)): scan selects either scan mode or single mode for operation. see section 14.4, operation, for descriptions of these modes. the mode should be changed only when the adst bit is cleared to 0. bit 4 (scan) description 0 single mode (initial value) 1 scan mode
413 ? bit 3 (clock select (cks)): cks selects the a/d conversion time. the conversion time should be changed only when the adst bit is cleared to 0. bit 3 (cks) description 0 conversion time = 266 states (maximum) (initial value) 1 conversion time = 134 states (maximum) ? bits 2? (channel select 2? (ch2?h0)): ch2?h0 select analog input channels together with the scan bit. the channel selection should be changed only when the adst bit is cleared to 0. group select channel select selected channels ch2 ch1 ch0 single mode scan mode 0 0 0 an0 an0 (initial value) 0 1 an1 an0 and an1 1 0 an2 an0?n2 1 1 an3 an0?n3 1 0 0 an4 an4 0 1 an5 an4 and an5 1 0 an6 an4?n6 1 1 an7 an4?n7 14.2.3 a/d control register (adcr) the a/d control register (adcr) is an 8-bit read/write register that selects whether or not to start the a/d conversion when an external trigger is input. adcr is initialized to h'7f by a reset and in standby mode. bit: 7 6 5 4 3 2 1 0 bit name: trge initial value: 0 1 1 1 1 1 1 1 r/w: r/w
414 ? bit 7 (trigger enable (trge)): trge selects whether or not to start a/d conversion when an external trigger is input. bit 7 (trge) description 0 when an external trigger is input, a/d conversion does not start (initial value) 1 a/d conversion starts at the falling edge of an input signal from the external trigger pin ( adtrg ). ? bits 6? (reserved): these bits are always read as 1. the write value should always be 1. 14.3 cpu interface the a/d data registers (addra?ddrd) are 16-bit registers, but they are connected to the cpu by an 8-bit data bus. therefore, the upper byte of each register can be read directly, but the lower byte is accessed through an 8-bit temporary register (temp). when the cpu reads the upper byte of an a/d data register, the upper byte is transferred to the cpu and the lower byte to temp. when the lower byte is accessed, the value in temp is transferred to the cpu. a program should first read the upper byte, then the lower byte of the a/d data register. this can be performed by reading addr from the upper byte end using a word transfer instruction (mov.w, etc.). reading only the upper byte would assure the cpu of obtaining consistent data. if the program reads only the lower byte, however, consistent data will not be guaranteed. figure 14.2 shows the data flow during access to a/d data registers.
415 bus interface temp [h'40] addrn l [h'40] addrn h [h'aa] n = a to d cpu receives data h'aa upper byte read module internal data bus bus interface temp [h'40] addrn l [h'40] addrn h [h'aa] n = a to d cpu receives data h'40 lower byte read module internal data bus figure 14.2 read access to a/d data register (reading h'aa40)
416 14.4 operation the a/d converter operates by successive approximations with a 10-bit resolution. its two modes, single mode and scan mode, are described below. 14.4.1 single mode (scan = 0) in single mode, a/d conversion is performed on a single channel. a/d conversion starts when the adst bit in the a/d control/status register (adcsr) is set to 1 by software or an external trigger input. during the conversion process the adst bit remains set at 1. when the conversion is completed, the adst bit is automatically cleared to 0. when the conversion is completed, the adf bit is set to 1. if the interrupt enable bit (adie) in adcsr is also set to 1, an a/d conversion interrupt (adi) is requested. when adcsr is read and 1 is written in the adf bit, the adf bit is cleared to 0. before changing a mode or analog input channel, clear the adst bit in adcsr to 0 to stop a/d conversion in order to prevent malfunctions. setting the adst bit to 1 after changing the mode or channel starts a/d conversion again (changing the mode or channel and setting the adst bit can be performed simultaneously). the following is an example of the a/d conversion process in single mode when channel 1 (an1) is selected. see figure 14.3 for the timing. 1. the program selects single mode (scan = 0) and input channel an1 (ch2 = ch1 = 0, ch0 = 1), enables the a/d interrupt request (adie = 1), and sets the adst bit to 1 to start a/d conversion. 2. at the end of the conversion process the a/d converter transfers the result to register addrb, sets the adf bit to 1, clears the adst bit to 0, and halts. 3. since adf = 1 and adie = 1, an a/d interrupt is requested. 4. the a/d interrupt handling routine is started. 5. the interrupt handling routine reads the adf value; since it is 1, it writes a 0 into the adf bit. 6. the interrupt handling routine reads and processes the a/d conversion result (addrb). 7. the routine ends. steps 2? can now be repeated by setting the adst bit to 1 again.
417 channel 0 (an0) operating adie adst adf channel 1 (an1) operating channel 2 (an2) operating channel 3 (an3) operating addra addrb addrc addrd waiting waiting waiting waiting waiting waiting a/d conversion starts set * set * set * clear * clear * a/d conversion result 1 a/d conversion result 2 read result read result a/d conversion 1 a/d conversion result 2 note: * downward arrows ( figure 14.3 a/d operation in single mode (channel 1 selected)
418 14.4.2 scan mode (scan = 1) scan mode can be used to monitor analog inputs on one or more channels. when the adst bit in adcsr is set to 1 by software or an external trigger input, a/d conversion starts with the first channel (an0 when ch2 = 0, an4 when ch2 = 1) in the group. if the scan group includes more than one channel, conversion of the second channel (an1 or an5) begins as soon as conversion of the first channel ends. conversion of the selected channels continues cyclically until the adst bit is cleared to 0. the conversion results are stored in the data registers corresponding to the selected channels. before changing a mode or analog input channels, clear the adst bit in adcsr to 0 to stop a/d conversion in order to prevent malfunctions. setting the adst bit to 1 after changing the mode or channel selects the first channel and starts a/d conversion again (changing the mode or channel and setting the adst bit can be performed simultaneously). the following is an example of the a/d conversion process in scan mode when three channels in group 0 are selected (an0, an1, and an2). see figure 14.4 for the timing. 1. the program selects scan mode (scan = 1), scan group 0 (ch2 = 0), and analog input channels an0 an2 (ch1 = 1, ch2 = ch0 = 0), then sets the adst bit to 1 to start a/d conversion. 2. the a/d converter samples the input at the first channel (an0), converts the voltage level to a digital value, and transfers the result to register addra. next, the second channel (an1) is automatically selected and conversion begins. 3. then it does the same for the third channel (an2). 4. after all selected channels (an0 an2) have been converted, the a/d converter sets the adf bit to 1 and begins conversion on channel an0 again. if the adie bit is set to 1, an a/d interrupt (adi) is requested after the a/d conversion. 5. steps 2 4 are repeated cyclically as long as the adst bit remains set at 1. to stop a/d conversion, clear the adst bit to 0. the moment the adst bit is set to 1 again, a/d conversion begins with the first channel (an0).
419 channel 0 (an0) operating adst adf channel 1 (an1) operating channel 2 (an2) operating channel 3 (an3) operating addra addrb addrc addrd waiting waiting waiting waiting * 2 waiting set * 1 clear * 1 clear * 1 a/d conversion result 2 waiting waiting waiting a/d conversion result 4 a/d conversion result 3 a/d conversion 1 waiting a/d conversion result 1 transfer a/d conversion 5 a/d conversion 3 a/d conversion time a/d conversion 4 continuous a/d conversion a/d conversion 2 notes: * 1 downward arrow indicates instruction executed by software. * 2 data being converted is ignored. figure 14.4 a/d operation in scan mode (channels 0? selected)
420 14.4.3 input sampling time and a/d conversion time with a built-in sample-and-hold circuit, the a/d converter performs input sampling at time t d after control/status register (adscr) access is started. see figure 14.5 for a/d conversion timing and table 14.4 for a/d conversion times. the total conversion time includes t d and the input sampling time, as shown in figure 14.5. the purpose of t d is to synchronize the adcsr write time with the a/d conversion process; therefore the duration of t d is variable. as a result, the total conversion time varies within the ranges shown in table 14.4. in scan mode, the ranges given in table 14.4 apply to the first conversion. the duration of the second and subsequent conversion processes is fixed at 256 states (cks = 0) or 128 states (cks = 1). ck write signal adf * 1 input sampling timing address * 2 t d t spl t conv t d a/d start delay t spl input sampling time t conv a/d conversion time notes: * 1 adscr write cycle * 2 adscr address figure 14.5 a/d conversion timing
421 table 14.4 a/d conversion time (single mode) cks = 0 cks = 1 item symbol min typ max min typ max a/d start delay t d 10 17 6 9 input sampling time t spl 64 32 total a/d conversion time t conv 259 266 131 134 note: values are the number of states (tcyc). 14.4.4 a/d conversion start by external trigger input the a/d converter can be started when an external trigger is input. the external trigger is input from the adtrg adtrg adtrg figure 14.6 external trigger input timing 14.5 interrupts and dma transfer requests the a/d converter can generate an a/d interrupt (adi) request at the end of conversion. the adi request is enabled by setting the adie bit in adcsr to 1, or is disabled by clearing the bit to 0. when adi is generated, the dmac can be started. dma transfers can be performed by requesting an adi interrupt by setting the resource select bits (rs3 rs0) in the dma channel control register (chcr) of the direct memory access controller (dmac). the adf bit in the a/d control/status register (adcsr) is automatically cleared to 0 when the dmac accesses an a/d converter register.
422 14.6 definitions of a/d conversion accuracy the a/d converter compares an analog value input from an analog input channel to its analog reference value and converts it into 10-bit digital data. the absolute accuracy of this a/d conversion is the deviation between the input analog value and the output digital value. it includes the following errors: ? ? ? ? figure 14.7 definitions of a/d conversion accuracy
423 14.7 a/d converter usage notes when using the a/d converter, note the points listed in section 14.7.1 below. 14.7.1 setting analog input voltage ? ? ? ? 14.7.2 handling of analog input pins to prevent damage from voltage surges at the analog input pins (an0 an7), connect an input protection circuit like the one shown in figure 14.8. the circuit shown also includes an rc filter to prevent errors due to noise. this circuit is shown as an example: the circuit constants should be selected according to actual application conditions. table 14.5 list the analog input pin specifications and figure 14.9 shows an equivalent circuit diagram of the analog input ports. 0.01 an7 av ss superh microcomputer ** 100 ? figure 14.8 example of analog input protection circuit
424 1.0 k ? an7 analog multiplexer a/d converter 20 pf 1 m ? figure 14.9 analog input pin equivalent circuit table 14.5 analog input pin ratings item min max unit analog input capacitance 20 pf allowable signal-source impedance 3k ? 14.7.3 switchover between analog input and general port functions 1. switchover to/from general port function when the a/d converter is started by setting the a/d start bit (adst) to 1 in the a/d control/status register (adcsr), or by asserting the _adtrg pin, port c pins begin functioning as analog input pins (ann). when a/d conversion ends, the pins are switched back to the general port (digital input) function. 2. port c pins not used for a/d conversion pins not selected as an pins by the channel select setting can be used in the following combinations as general port pins in both single mode and scan mode. (a) when any or all of pins an0 to an3 are used for a/d conversion, an4 to an7 can be used as general port pins. (b) when any or all of pins an4 to an7 are used for a/d conversion, an0 to an3 can be used as general port pins.
425 section 15 pin function controller (pfc) 15.1 overview the pin function controller (pfc) is composed of registers for selecting the function of multiplexed pins and the direction of input/output. the pin function and input/output direction can be selected for each pin individually without regard to the operating mode of the chip. table 15.1 lists the multiplexed pins. table 15.1 list of multiplexed pins port function 1 (related module) function 2 (related module) function 3 (related module) function 4 (related module) pin no. (fp-112) pin no. (tfp-120) a pa15 i/o (port) irq3 input (intc) dreq1 input (dmac) ?974 a pa14 i/o (port) irq2 input (intc) dack1 output (dmac) 68 * 3 73 * 3 a pa13 i/o (port) irq1 input (intc) tclkb input (itu) dreq0 input (dmac) 67 72 a pa12 i/o (port) irq0 input (intc) tclka input (itu) dack0 output (dmac) 66 * 3 71 * 3 a pa11 i/o (port) dph i/o (d bus) tiocb1 i/o (itu) 65 70 a pa10 i/o (port) dpl i/o (d bus) tioca1 i/o (itu) 64 69 a pa9 i/o (port) ah output (bsc) adtrg input (a/d) irqout output (intc) 63 68 a pa8 i/o (port) breq input (system) 62 67 a pa7 i/o (port) back output (system) 60 65 a pa6 i/o (port) rd output (bsc) 59 64 a pa5 i/o (port) wrh output (bsc) ( lbs output (bsc)) * 1 5863 a pa4 i/o (port) wrl output (bsc) ( wr output (bsc)) * 1 5762 a pa3 i/o (port) cs7 output (bsc) wait input (bsc) 56 59 a pa2 i/o (port) cs6 output (bsc) tiocb0 i/o (itu) 55 58 a pa1 i/o (port) cs5 output (bsc) ras output (bsc) 54 57 a pa0 i/o (port) cs4 output (bsc) tioca0 i/o (itu) 53 56
426 table 15.1 list of multiplexed pins (cont) port function 1 (related module) function 2 (related module) function 3 (related module) function 4 (related module) pin no. (fp-112) pin no. (tfp-120) b pb15 i/o (port) irq7 input (intc) tp15 output (tpc) 2 3 b pb14 i/o (port) irq6 input (intc) tp14 output (tpc) 1 2 b pb13 i/o (port) irq5 input (intc) sck1 i/o (sci) tp13 output (tpc) 112 119 b pb12 i/o (port) irq4 input (intc) sck0 i/o (sci) tp12 output (tpc) 111 118 b pb11 i/o (port) txd1 output (sci) tp11 output (tpc) 110 117 b pb10 i/o (port) rxd1 input (sci) tp10 output (tpc) 109 116 b pb9 i/o (port) txd0 output (sci) tp9 output (tpc) 108 115 b pb8 i/o (port) rxd0 input (sci) tp8 output (tpc) 107 114 b pb7 i/o (port) tclkd input (itu) tocxb4 output (itu) tp7 output (tpc) 105 112 b pb6 i/o (port) tclkc input (itu) tocxa4 output (itu) tp6 output (tpc) 104 111 b pb5 i/o (port) tiocb4 i/o (itu) tp5 output (tpc) 103 110 b pb4 i/o (port) tioca4 i/o (itu) tp4 output (tpc) 102 109 b pb3 i/o (port) tiocb3 i/o (itu) tp3 output (tpc) 101 108 b pb2 i/o (port) tioca3 i/o (itu) tp2 output (tpc) 100 107 b pb1 i/o (port) tiocb2 i/o (itu) tp1 output (tpc) 98 105 b pb0 i/o (port) tioca2 i/o (itu) tp0 output (tpc) 97 103 c pc7 input (port) an7 input (a/d) 95 * 2 101 * 2 c pc6 input (port) an6 input (a/d) 94 * 2 100 * 2 c pc5 input (port) an5 input (a/d) 93 * 2 99 * 2 c pc4 input (port) an4 input (a/d) 92 * 2 98 * 2 c pc3 input (port) an3 input (a/d) 90 * 2 96 * 2 c pc2 input (port) an2 input (a/d) 89 * 2 95 * 2 c pc1 input (port) an1 input (a/d) 88 * 2 94 * 2 c pc0 input (port) an0 input (a/d) 87 * 2 93 * 2 cs1 output (bsc) cash output (bsc) 49 52 cs3 output (bsc) casl output (bsc) 51 54 intc: interrupt controller dmac: direct memory access controller itu: 16-bit integrated timer pulse unit d bus: data bus control bsc: bus state controller system: system control a/d: a/d converter
427 sci: serial communication interface tpc: programmable timing pattern controller port: i/o port notes: * 1 the bus control register of the bus state controller handles switching between the two functions. * 2 the function of port c pins automatically changes to analog input (an0?n7) when the a/d converter begins to operate. * 3 the initial setting is dack (output). 15.2 register configuration table 15.2 summarizes the registers of the pin function controller. table 15.2 pin function controller registers name abbreviation r/w initial value address * access size port a i/o register paior r/w h'0000 h'5ffffc4 8, 16, 32 port a control register 1 pacr1 r/w h'3302 h'5ffffc8 8, 16, 32 port a control register 2 pacr2 r/w h'ff95 h'5ffffca 8, 16, 32 port b i/o register pbior r/w h'0000 h'5ffffc6 8, 16, 32 port b control register 1 pbcr1 r/w h'0000 h'5ffffcc 8, 16, 32 port b control register 2 pbcr2 r/w h'0000 h'5ffffce 8, 16, 32 column address strobe pin control register cascr r/w h'5fff h'5ffffee 8, 16, 32 note: * only the values of bits a27?24 and a8?0 are valid; bits a23?9 are ignored. for details on the register addresses, see section 8.3.5, area descriptions. 15.3 register descriptions 15.3.1 port a i/o register (paior) the port a i/o register (paior) is a 16-bit read/write register that selects input or output for the 16 pins of port a. bits pa15ior?a0ior correspond to pins pa15/ irq3 / dreq1 pa0/ cs4 /tioca0. paior is enabled when the port a pins function as input/outputs (pa15 pa0) and for itu input capture and output compare (tioca1, tioca0, tiocb1, and tiocb0). for other functions, they are disabled. for port a pin functions pa15?a0 and tioca1, tioca0, tiocb1, and tiocb0, a given pin in port a is an output pin if its corresponding paior bit is set to 1, and an input pin if the bit is cleared to 0. paior is initialized to h'0000 by a power-on reset; however, it is not initialized by a manual reset, or in standby mode or sleep mode.
428 bit: 15 14 13 12 11 10 9 8 bit name: pa15 ior pa14 ior pa13 ior pa12 ior pa11 ior pa10 ior pa9 ior pa8 ior initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: pa7 ior pa6 ior pa5 ior pa4 ior pa3 ior pa2 ior pa1 ior pa0 ior initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w 15.3.2 port a control registers (pacr1 and pacr2) pacr1 and pacr2 are 16-bit read/write registers that select the functions of the sixteen multiplexed pins of port a. pacr1 selects the function of the upper eight bits of port a; pacr2 selects the function of the lower eight bits of port a. pacr1 and pacr2 are initialized to h'3302 and h'ff95 respectively by a power-on reset but are not initialized by a manual reset, or in standby mode or sleep mode. pacr1: bit: 15 14 13 12 11 10 9 8 bit name: pa15 md1 pa15 md0 pa14 md1 pa14 md0 pa13 md1 pa13 md0 pa12 md1 pa12 md0 initial value: 0 0 1 1 0 0 1 1 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: pa11 md1 pa11 md0 pa10 md1 pa10 md0 pa9 md1 pa9 md0 pa8 md initial value: 0 0 0 0 0 0 1 0 r/w: r/w r/w r/w r/w r/w r/w r/w ? bits 15 and 14 (pa15 mode (pa15md1 and pa15md0)): pa15md1 and pa15md0 select the function of the pa15/ irq3 / dreq1 pin.
429 bit 15: pa15md1 bit 14: pa15md0 function 0 0 input/output (pa15) (initial value) 1 interrupt request input ( irq3 ) 1 0 reserved 1 dma transfer request input ( dreq1 ) ? bits 13 and 12 (pa14 mode (pa14md1 and pa14md0)): pa14md1 and pa14md0 select the function of the pa14/ irq2 /dack1 pin. bit 13: pa14md1 bit 12: pa14md0 function 0 0 input/output (pa14) 1 interrupt request input ( irq2 ) 1 0 reserved 1 dma transfer acknowledge output (dack1) (initial value) ? bits 11 and 10 (pa13 mode (pa13md1 and pa13md0)): pa13md1 and pa13md0 select the function of the pa13/ irq1 / dreq0 /tclkb pin. bit 11: pa13md1 bit 10: pa13md0 function 0 0 input/output (pa13) (initial value) 1 interrupt request input ( irq1 ) 1 0 itu timer clock input (tclkb) 1 dma transfer request input ( dreq0 ) ? bits 9 and 8 (pa12 mode (pa12md1 and pa12md0)): pa12md1 and pa12md0 select the function of the pa12/ irq0 /dack0/tclka pin. bit 9: pa12md1 bit 8: pa12md0 function 0 0 input/output (pa12) 1 interrupt request input ( irq0 ) 1 0 itu timer clock input (tclka) 1 dma transfer acknowledge output (dack0) (initial value)
430 ? bits 7 and 6 (pa11 mode (pa11md1 and pa11md0)): pa11md1 and pa11md0 select the function of the pa11/dph/tiocb1 pin. bit 7: pa11md1 bit 6: pa11md0 function 0 0 input/output (pa11) (initial value) 1 upper data bus parity input/output (dph) 1 0 itu input capture/output compare (tiocb1) 1 reserved ? bits 5 and 4 (pa10 mode (pa10md1 and pa10md0)): pa10md1 and ma10md0 select the function of the pa10/dpl/tioca1 pin. bit 5: pa10md1 bit 4: pa10md0 function 0 0 input/output (pa10) (initial value) 1 lower data bus parity input/output (dpl) 1 0 itu input capture/output compare (tioca1) 1 reserved ? bits 3 and 2 (pa9 mode (pa9md1 and pa9md0)): pa9md1 and pa9md0 select the function of the pa9/ ah / irqout / adtrg pin. bit 3: pa9md1 bit 2: pa9md0 function 0 0 input/output (pa9) (initial value) 1 address hold output ( ah ) 1 0 a/d conversion trigger input ( adtrg ) 1 interrupt request output ( irqout ) ? bit 1 (reserved): this bit is always read as 1. the write value should always be 1. ? bit 0 (pa8 mode (pa8md)): pa8md selects the function of the pa8/ breq pin. bit 0: pa8md function 0 input/output (pa8) (initial value) 1 bus request input ( breq )
431 pacr2: bit: 15 14 13 12 11 10 9 8 bit name: pa7md pa6md pa5md pa4md initial value: 1 1 1 1 1 1 1 1 r/w: r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: pa3md1 pa3md0 pa2md1 pa2md0 pa1md1 pa1md0 pa0md1 pa0md0 initial value: 1 0 0 1 0 1 0 1 r/w: r/w r/w r/w r/w r/w r/w r/w r/w ? bit 15 (reserved): this bit is always read as 1. the write value should always be 1. ? bit 14 (pa7 mode (pa7md)): pa7md selects the function of the pa7/ back pin. bit 14: pa7md function 0 input/output (pa7) 1 bus request acknowledge output ( back ) (initial value) ? bit 13 (reserved): this bit is always read as 1. the write value should always be 1. ? bit 12 (pa6 mode (pa6md)): pa6md selects the function of the pa6/ rd pin. bit 12: pa6md function 0 input/output (pa6) 1 read output ( rd ) (initial value) ? bit 11 (reserved): this bit is always read as 1. the write value should always be 1. ? bit 10 (pa5 mode (pa5md)): pa5md selects the function of the pa5/ wrh ( lbs ) pin. bit 10: pa5md function 0 input/output (pa5) 1 upper write output ( wrh ) or lower byte strobe output ( lbs ) (initial value) ? bit 9 (reserved): this bit is alway read as 1. the write value should always be 1.
432 ? bit 8 (pa4 mode (pa4md)): pa4md selects the function of the pa4/ wrl ( wr ) pin. bit 8: pa4md function 0 input/output (pa4) 1 lower write output ( wrl ) or write output ( wr ) (initial value) ? bits 7 and 6 (pa3 mode (pa3md1 and pa3md0)): pa3md1 and pa3md0 select the function of the pa3/ cs7 / wait pin. this pin has a pull-up mos that is used when it functions as a wait pin to allow selection of pull-up or no pull-up (for the wait pin) using the wait state control register of the bus state controller (bsc). there is no pull-up when it functions as pa3 or cs7 . bit 7: pa3md1 bit 6: pa3md0 function 0 0 input/output (pa3) 1 chip select output ( cs7 ) 1 0 wait state input ( wait ) (initial value) 1 reserved ? bits 5 and 4 (pa2 mode (pa2md1 and pa2md0)): pa2md1 and pa2md0 select the function of the pa2/ cs6 /tiocb0 pin. bit 5: pa2md1 bit 4: pa2md0 function 0 0 input/output (pa2) 1 chip select output ( cs6 ) (initial value) 1 0 itu input capture/output compare (tiocb0) 1 reserved ? bits 3 and 2 (pa1 mode (pa1md1 and pa1md0)): pa1md1 and pa1md0 select the function of the pa1/ cs5 / ras pin. bit 3: pa1md1 bit 2: pa1md0 function 0 0 input/output (pa1) 1 chip select output ( cs5 ) (initial value) 1 0 row address strobe output ( ras ) 1 reserved
433 ? bits 1 and 0 (pa0 mode (pa0md1 and pa0md0)): pa0md1 and pa0md0 select the function of the pa0/ cs4 /tioca0 pin. bit 1: pa0md1 bit 0: pa0md0 function 0 0 input/output (pa0) 1 chip select output ( cs4 ) (initial value) 1 0 itu input capture/output compare (tioca0) 1 reserved 15.3.3 port b i/o register (pbior) the port a i/o register (paior) is a 16-bit read/write register that selects input or output for the 16 pins of port a. bits pb15ior?b0ior correspond to pins of port b. pbior is enabled when the port b pins function as input/outputs (pb15?b0), for itu input capture and output compare (tioca4, tioca3, tioca2, tiocb4, tiocb3, and tiocb2), and as serial clocks (sck1, sck0). for other functions, they are disabled. for port b pin functions pb15?b0, and tioca4, tioca3, tioca2, tiocb4, tiocb3, and tiocb2, and sck1/sck0, a given pin in port b is an output pin if its corresponding pbior bit is set to 1, and an input pin if the bit is cleared to 0. pbior is initialized to h'0000 by a power-on reset; however, it is not initialized by a manual reset, or in standby mode or sleep mode. bit: 15 14 13 12 11 10 9 8 bit name: pb15 ior pb14 ior pb13 ior pb12 ior pb11 ior pb10 ior pb9 ior pb8 ior initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: pb7 ior pb6 ior pb5 ior pb4 ior pb3 ior pb2 ior pb1 ior pb0 ior initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w
434 15.3.4 port b control registers (pbcr1 and pbcr2) pbcr1 and pbcr2 are 16-bit read/write registers that select the functions of the sixteen multiplexed pins of port b. pbcr1 selects the function of the upper eight bits of port b; pbcr2 selects the function of the lower eight bits of port b. pbcr1 and pbcr2 are initialized to h'0000 by a power-on reset, but are not initialized by a manual reset, or in standby mode or sleep mode. pbcr1: bit: 15 14 13 12 11 10 9 8 bit name: pb15 md1 pb15 md0 pb14 md1 pb14 md0 pb13 md1 pb13 md0 pb12 md1 pb12 md0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: pb11 md1 pb11 md0 pb10 md1 pb10 md0 pb9 md1 pb9 md0 pb8 md1 pb8 md0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w ? bits 15 and 14 (pb15 mode (pb15md1 and pb15md0)): pb15md1 and pb15md0 select the function of the pb15/tp15/ irq7 pin. bit 15: pb15md1 bit 14: pb15md0 function 0 0 input/output (pb15) (initial value) 1 interrupt request input ( irq7 ) 1 0 reserved 1 timing pattern output (tp15) ? bits 13 and 12 (pb14 mode (pb14md1 and pb14md0)): pb14md1 and pb14md0 select the function of the pb14/tp14/ irq6 pin. bit 13: pb14md1 bit 12: pb14md0 function 0 0 input/output (pb14) (initial value) 1 interrupt request input ( irq6 ) 1 0 reserved 1 timing pattern output (tp14)
435 ? bits 11 and 10 (pb13 mode (pb13md1 and pb13md0)): pb13md1 and pb13md0 select the function of the pb13/tp13/ irq5 /sck1 pin. bit 11: pb13md1 bit 10: pb13md0 function 0 0 input/output (pb13) (initial value) 1 interrupt request input ( irq5 ) 1 0 serial clock input/output (sck1) 1 timing pattern output (tp13) ? bits 9 and 8 (pb12 mode (pb12md1 and pb12md0)): pb12md1 and pb12md0 select the function of the pb12/tp12/ irq4 /sck0 pin. bit 9: pb12md1 bit 8: pb12md0 function 0 0 input/output (pb12) (initial value) 1 interrupt request input ( irq4 ) 1 0 serial clock input/output (sck0) 1 timing pattern output (tp12) ? bits 7 and 6: pb11 mode (pb11md1 and pb11md0): pb11md1 and pb11md0 select the function of the pb11/tp11/txd1 pin. bit 7: pb11md1 bit 6: pb11md0 function 0 0 input/output (pb11) (initial value) 1 reserved 1 0 transmit data output (txd1) 1 timing pattern output (tp11) ? bits 5 and 4 (pb10 mode (pb10md1 and pb10md0): pb10md1 and pb10md0 select the function of the pb10/tp10/rxd1 pin. bit 5: pb10md1 bit 4: pb10md0 function 0 0 input/output (pb10) (initial value) 1 reserved 1 0 receive data input (rxd1) 1 timing pattern output (tp10)
436 ? bits 3 and 2 (pb9 mode (pb9md1 and pb9md0)): pb9md1 and pb9md0 select the function of the pb9/tp9/txd0 pin. bit 3: pb9md1 bit 2: pb9md0 function 0 0 input/output (pb9) (initial value) 1 reserved 1 0 transmit data output (txd0) 1 timing pattern output (tp9) ? bits 1 and 0 (pb8 mode (pb8md1 and pb8md0)): pb8md1 and pb8md0 select the function of the pb8/tp8/rxd0 pin. bit 1: pb8md1 bit 0: pb8md0 function 0 0 input/output (pb8) (initial value) 1 reserved 1 0 receive data input (rxd0) 1 timing pattern output (tp8) pbcr2: bit: 15 14 13 12 11 10 9 8 bit name: pb7md1 pb7md0 pb6md1 pb6md0 pb5md1 pb5md0 pb4md1 pb4md0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: pb3md1 pb3md0 pb2md1 pb2md0 pb1md1 pb1md0 pb0md1 pb0md0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w
437 ? bits 15 and 14 (pb7 mode (pb7md1 and pb7md0)): pb7md1 and pb7md0 select the function of the pb7/tp7/tocxb4/tclkd pin. bit 15: pb7md1 bit 14: pb7md0 function 0 0 input/output (pb7) (initial value) 1 itu timer clock input (tclkd) 1 0 itu output compare (tocxb4) 1 timing pattern output (tp7) ? bits 13 and 12 (pb6 mode (pb6md1 and pb6md0)): pb6md1 and pb6md0 select the function of the pb6/tp6/tocxa4/tclkc pin. bit 13: pb6md1 bit 12: pb6md0 function 0 0 input/output (pb6) (initial value) 1 itu timer clock input (tclkc) 1 0 itu output compare (tocxa4) 1 timing pattern output (tp6) ? bits 11 and 10 (pb5 mode (pb5md1 and pb5md0)): pb5md1 and pb5md0 select the function of the pb5/tp5/tiocb4 pin. bit 11: pb5md1 bit 10: pb5md0 function 0 0 input/output (pb5) (initial value) 1 reserved 1 0 itu input capture/output compare (tiocb4) 1 timing pattern output (tp5) ? bits 9 and 8 (pb4 mode (pb4md1 and pb4md0)): pb4md1 and pb4md0 select the function of the pb4/tp4/tioca4 pin. bit 9: pb4md1 bit 8: pb4md0 function 0 0 input/output (pb4) (initial value) 1 reserved 1 0 itu input capture/output compare (tioca4) 1 timing pattern output (tp4)
438 ? bits 7 and 6 (pb3 mode (pb3md1 and pb3md0)): pb3md1 and pb3md0 select the function of the pb3/tp3/tiocb3 pin. bit 7: pb3md1 bit 6: pb3md0 function 0 0 input/output (pb3) (initial value) 1 reserved 1 0 itu input capture/output compare (tiocb3) 1 timing pattern output (tp3) ? bits 5 and 4 (pb2 mode (pb2md1 and pb2md0)): pb2md1 and pb2md0 select the function of the pb2/tp2/tioca3 pin. bit 5: pb2md1 bit 4: pb2md0 function 0 0 input/output (pb2) (initial value) 1 reserved 1 0 itu input capture/output compare (tioca3) 1 timing pattern output (tp2) ? bits 3 and 2 (pb1 mode (pb1md1 and pb1md0)): pb1md1 and pb1md0 select the function of the pb1/tp1/tiocb2 pin. bit 3: pb1md1 bit 2: pb1md0 function 0 0 input/output (pb1) (initial value) 1 reserved 1 0 itu input capture/output compare (tiocb2) 1 timing pattern output (tp1) ? bits 1 and 0 (pb0 mode (pb0md1 and pb0md0)): pb0md1 and pb0md0 select the function of the pb0/tp0/tioca2 pin. bit 1: pb0md1 bit 0: pb0md0 function 0 0 input/output (pb0) (initial value) 1 reserved 1 0 itu input capture/output compare (tioca2) 1 timing pattern output (tp0)
439 15.3.5 column address strobe pin control register (cascr) cascr is a 16-bit read/write register that allows selection between column address strobe and chip select pin functions. cascr is initialized to h'5fff by a power-on reset, but is not initialized by a manual reset, or in standby mode or sleep mode. bit: 15 14 13 12 11 10 9 8 bit name: cash md1 cash md0 casl md1 casl md0 initial value: 0 1 0 1 1 1 1 1 r/w: r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: initial value: 1 1 1 1 1 1 1 1 r/w: ? bits 15 and 14 (cash mode (cashmd1 and cashmd0)): cashmd1 and cashmd0 select the function of the cs1 / cash pin. bit 15: cashmd1 bit 14: cashmd0 function 0 0 reserved 1 chip select output ( cs1 ) (initial value) 1 0 column address strobe output ( cash ) 1 reserved ? bits 13 and 12 (casl mode (caslmd1 and caslmd0)): caslmd1 and caslmd0 select the function of the cs3 / casl pin. bit 13: caslmd1 bit 12: caslmd0 function 0 0 reserved 1 chip select output ( cs3 ) (initial value) 1 0 column address strobe output ( casl ) 1 reserved ? bits 11? (reserved): these bits are always read as 1. the write value should always be 1.
440
441 section 16 i/o ports (i/o) 16.1 overview there are three ports, a, b, and c. ports a and b are 16-bit i/o ports, while port c is an 8-bit input port. the pins of the ports are all multiplexed for use as general-purpose i/os (or inputs in the case of port c) or for other functions. (use the pin function controller (pfc) to select the function of multiplexed pins.) ports a, b, and c each have one data register for storing pin data. 16.2 port a port a is a 16-pin input/output port, as shown in figure 16.1. the pa3/ cs7 / wait pin of port a has a pull-up mos so that when it is functioning as a wait pin, the wait state control register of the bus state controller can be used to select whether to pull up the wait pin or not. it is not pulled up when the pin is functioning as either pa3 or cs7 . port a pa 15 (input/output)/ irq3 (input)/ dreq1 (input) pa 14 (input/output)/ irq2 (input)/dack1 (output) pa 13 (input/output)/ irq1 (input)/ dreq0 (input)/tclkb (input) pa 12 (input/output)/ irq0 (input)/dack0 (output)/tclka (input) pa 11 (input/output)/dph (input/output)/tiocb1 (input/output) pa 10 (input/output)/dpl (input/output)/tioca1 (input/output) pa 9 (input/output)/ ah (output)/ irqout (output)/ adtrg (input) pa 8 (input/output)/ breq (input) pa 7 (input/output)/ back (output) pa 6 (input/output)/ rd (output) pa 5 (input/output)/ wrh (output) ( lbs (output)) pa 4 (input/output)/wrl (output) ( wr (output)) pa 3 (input/output)/ cs7 (output)/ wait (input) pa 2 (input/output)/ cs6 (output)/tiocb0 (input/output) pa 1 (input/output)/ cs5 (output)/ ras (output) pa 0 (input/output)/ cs4 (output)/tioca0 (input/output) figure 16.1 port a configuration 16.2.1 register configuration table 16.1 summarizes the port a register.
442 table 16.1 port a register name abbreviation r/w initial value address * access size port a data register padr r/w h'0000 h'5ffffc0 8, 16, 32 note: * only the values of bits a27?24 and a8?0 are valid; bits a23?9 are ignored. for details on the register addresses, see section 8.3.5, area descriptions. 16.2.2 port a data register (padr) padr is a 16-bit read/write register that stores data for port a. bits pa15dr?a0dr correspond to the pa15/ irq3 / dreq1 ?a0/ cs4 /tioca0 pins. when the pins are used as ordinary outputs, they will output whatever value is written in padr; when padr is read, the register value will be output regardless of the pin status. when the pins are used as ordinary inputs, the pin status rather than the register value is read directly when padr is read. when a value is written to padr, that value can be written into padr, but it will not affect the pin status. table 16.2 shows port a data register read/write operations. padr is initialized by a power-on reset. however, padr is not initialized by a manual reset, or in standby mode or sleep mode. bit: 15 14 13 12 11 10 9 8 bit name: pa15dr pa14dr pa13dr pa12dr pa11dr pa10dr pa9dr pa8dr initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: pa7dr pa6dr pa5dr pa4dr pa3dr pa2dr pa1dr pa0dr initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w table 16.2 port a data register (padr) read/write operations paior pin status read write 0 input pin status can write to padr, but it has no effect on pin status. other function pin status can write to padr, but it has no effect on pin status. 1 output padr value value written is output by pin other function padr value can write to padr, but it has no effect on pin status.
443 16.3 port b port b is a 16-bit input/output port as shown in figure 16.2. port b pb 15 (input/output)/tp 15 (output)/ irq7 (input) pb 14 (input/output)/tp 14 (output)/ irq6 (input) pb 13 (input/output)/tp 13 (output)/ irq5 (input)/sck1 (input/output) pb 12 (input/output)/tp 12 (output)/ irq4 (input)/sck0 (input/output) pb 11 (input/output)/tp 11 (output)/txd1 (output) pb 10 (input/output)/tp 10 (output)/rxd1 (input) pb 9 (input/output)/tp 9 (output)/txd0 (output) pb 8 (input/output)/tp 8 (output)/rxd0 (input) pb 7 (input/output)/tp 7 (output)/tocxb4 (output)/tclkd (input) pb 6 (input/output)/tp 6 (output)/tocxa4 (output)/tclkc (input) pb 5 (input/output)/tp 5 (output)/tiocb4 (input/output) pb 4 (input/output)/tp 4 (output)/tioca4 (input/output) pb 3 (input/output)/tp 3 (output)/tiocb3 (input/output) pb 2 (input/output)/tp 2 (output)/tioca3 (input/output) pb 1 (input/output)/tp 1 (output)/tiocb2 (input/output) pb 0 (input/output)/tp 0 (output)/tioca2 (input/output) figure 16.2 port b configuration 16.3.1 register configuration table 16.3 summarizes the port b register. table 16.3 port b register name abbreviation r/w initial value address * access size port b data register pbdr r/w h'0000 h'5ffffc2 8, 16, 32 note: * only the values of bits a27 a24 and a8 a0 are valid; bits a23 a9 are ignored. for details on the register addresses, see section 8.3.5, area descriptions.
444 16.3.2 port b data register (pbdr) pbdr is a 16-bit read/write register that stores data for port b. bits pb15dr?b0dr correspond to the pb15/tp15/ irq7 ?b0/tp0/tioca2 pins. when the pins are used as ordinary outputs, they will output whatever value is written in pbdr; when pbdr is read, the register value will be output regardless of the pin status. when the pins are used as ordinary inputs, the pin status rather than the register value is read directly when pbdr is read. when a value is written to pbdr, that value can be written into pbdr, but it will not affect the pin status. when the pin function is set to timing pattern output and the tpc output is enabled by the tpc next data enable register (nder), no value can be written to pbdr. table 16.4 shows port b data register read/write operations. pbdr is initialized by a power-on reset. however, pbdr is not initialized by a manual reset, or in standby mode or sleep mode. bit: 15 14 13 12 11 10 9 8 bit name: pb15dr pb14dr pb13dr pb12dr pb11dr pb10dr pb9dr pb8dr initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: pb7dr pb6dr pb5dr pb4dr pb3dr pb2dr pb1dr pb0dr initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w table 16.4 port b data register (pbdr) read/write operations pbior pin status read write 0 input pin status can write to pbdr, but it has no effect on pin status tpn pin status disabled other function pin status can write to pbdr, but it has no effect on pin status 1 output pbdr value value written is output by pin tpn pbdr value disabled other function pbdr value can write to pbdr, but it has no effect on pin status tpn: timing pattern output
445 16.4 port c port c is an eight-bit input port as shown in figure 16.3. port c pc7 (input)/an7 (input) pc6 (input)/an6 (input) pc5 (input)/an5 (input) pc4 (input)/an4 (input) pc3 (input)/an3 (input) pc2 (input)/an2 (input) pc1 (input)/an1 (input) pc0 (input)/an0 (input) figure 16.3 port c configuration 16.4.1 register configuration table 16.5 summarizes the port c register. table 16.5 port c register name abbreviation r/w initial value address * access size port c data register pcdr r/w h'5ffffd0 8, 16, 32 note: * only the values of bits a27 a24 and a8 a0 are valid; bits a23 a9 are ignored. for details on the register addresses, see section 8.3.5, area descriptions.
446 16.4.2 port c data register (pcdr) pcdr is an 16-bit read-only register that stores data for port c (writes to bits 15? are ignored, and the read value is always undefined). bits pc7dr?c0dr correspond to the pc7/an7 pc0/an0 pins respectively. any values written to these bits will be ignored and will not affect the pin status. when the bits are read, the pin status rather than the bit value is read directly. when analog input of the a/d converter is being sampled, however, every bit is read as 1. table 16.6 shows port c data register read/write operations (bits 7?). pcdr is not initialized by a power-on reset or manual reset, or in standby mode or sleep mode (bits 15? are always undefined; bits 7? always reflect the pin status). bit: 15 14 13 12 11 10 9 8 bit name: initial value: r/w: r r r r r r r r bit: 7 6 5 4 3 2 1 0 bit name: pc7dr pc6dr pc5dr pc4dr pc3dr pc2dr pc1dr pc0dr initial value: r/w: r r r r r r r r table 16.6 port c data register (pcdr) read/write operations pin i/o pin function read write input general purpose pin status read ignored (no effect on pin status) ann read as 1 ignored (no effect on pin status) ann: analog input
447 section 17 rom 17.1 overview the sh7034 microcomputer has 64 kbytes of on-chip rom (mask rom or prom). the on-chip rom is connected to the cpu and the direct memory access controller (dmac) through a 32-bit data bus (figure 17.1). the cpu can access the on-chip rom in 8-, 16- and 32-bit widths and the dmac can access the rom in 8- and 16-bit widths. data in the on-chip rom can always be accessed in one cycle. h'0000000 h'0000004 h'0000001 h'0000005 h'0000002 h'0000006 h'0000003 h'0000007 h'000fffc h'000fffd h'000fffe h'000ffff on-chip rom internal data bus (32 bits) note: the addresses shown in the figure are the uppermost shadow addresses in the on-chip rom space. figure 17.1 block diagram of rom the operating mode determines whether the on-chip rom is valid or not. the operating mode is selected using mode-setting pins md0?d2 as shown in table 17.1. when using the on-chip rom, select mode 2; otherwise, select mode 0 or 1. the on-chip rom is allocated to addresses h'0000000?'000ffff of memory area 0. memory area 0 (h'0000000?'0ffffff and h'8000000?'8ffffff) is divided into 64-kbyte shadows. no matter which shadow is accessed, the on-chip rom is accessed. see section 8, bus state controller (bsc), for more information on shadows.
448 table 17.1 operating modes and rom mode setting pins operating mode md2 md1 md0 area 0 mode 0 (mcu mode 0) 0 0 0 on-chip rom disabled, external 8-bit space mode 1 (mcu mode 1) 0 0 1 on-chip rom disabled, external 16-bit space mode 2 (mcu mode 2) 0 1 0 on-chip rom enabled mode 7 (prom mode) 111 0: low 1: high when the sh7034 is set to prom mode, programs can be written in the prom version in the same way as with ordinary eprom, using a general-purpose eprom programmer. 17.2 prom mode 17.2.1 setting prom mode to program the on-chip prom, set the pins as shown in figure 17.2 and use the chip in prom mode. 17.2.2 socket adapter pin correspondence and memory map mount the socket adapter on the sh7034 as shown in figure 17.2. this allows the on-chip prom to be programmed in exactly the same way as ordinary 32-pin eproms (hn27c101). figure 17.2 shows the correspondence between sh7034 pins and hn27c101 pins. figure 17.3 shows the memory map of the on-chip rom. the address range of the hn27c101 (128 kbytes) is h'00000?'1ffff. the on-chip prom (64 kbytes) is not found in the latter half (h'10000?'1ffff). when programming with a prom programmer, the program address range must be set to h'0000 h'ffff. the data for the h'10000?'1ffff address area should all be h'ff. set byte mode, not page mode.
449 pin number 77 76 4 5 6 7 8 9 10 11 23 24 25 26 27 28 29 30 32 33 34 35 36 37 38 39 41 55 56 42 44 15, 43, 70, 75, 83, 84, 99 80 81 82 85, 86 79 3, 12, 22, 31, 40, 52, 61, 72, 96, 106 87 90, 92 95 91 pins other than the above pin name v pp nmi ad0 ad1 ad2 ad3 ad4 ad5 ad6 ad7 a0/ hbs cs6 cs7 wait res pc3/an3 pc4/an4 pc7/an7 av ss nc (leave open) pin number 1 26 13 14 15 17 18 19 20 21 12 11 10 9 8 7 6 5 27 24 23 25 4 28 29 3 2 32 16 pin name v pp a9 i/o0 i/o1 i/o2 i/o3 i/o4 i/o5 i/o6 i/o7 a0 a1 a2 a3 a4 a5 a6 a7 a8 oe a10 a11 a12 a13 a14 a15 a16 pgm ce sh7034 hn27c101 eprom socket adapter v pp : prom program power adapter (12.5 v) a16 a0: address input i/o7 i/o0: data input/ output oe ce figure 17.2 correspondence between sh7034 pins and hn27c101 pins
450 on-chip rom space (area 0) h'0000 h'ffff h'0000000 h'000ffff addresses in mcu modes 0, 1, and 2 * addresses in prom mode note: * addresses in the figure are the uppermost shadow addresses of the on-chip rom space. figure 17.3 memory map of on-chip rom 17.3 prom programming the write/verify specifications in prom mode are the same as for the standard eprom hn27c101. page programming is not supported, so do not set the prom programmer to page programming mode . naturally, prom programmers that only support page programming mode cannot be used. when selecting a prom programmer, check that the byte-by-byte high-speed, high-reliability programming method is supported. 17.3.1 selecting the programming mode there are two on-chip prom programming modes: write and verify (which reads and confirms the data written). use the pins to select the modes (table 17.2).
451 table 17.2 selecting prom programming mode pin mode ce oe pgm v pp v cc i/o7?/o0 a16?0 write 0 1 0 v pp v cc data input address input verify 0 0 1 data output program inhibit 0 0 0 high impedance 01 1 10 0 11 1 legend: 0: low 1: high v pp : v pp level v cc : v cc level 17.3.2 write/verify and electrical characteristics write/verify: write/verify can be accomplished by an efficient high-speed, high-reliability programming method. this method can write data quickly and accurately without placing voltage stress on the device. the basic flowchart for this high-speed, high-reliability programming method is shown in figure 17.4.
452 start set eprom programmer to write/verify mode (v cc = 6.0 v figure 17.4 basic flowchart of high-speed, high-reliability programming
453 electrical characteristics: tables 17.3 and 17.4 show the electrical characteristics of programming. figure 17.5 shows the timing. table 17.3 dc characteristics (v cc = 6.0 v 0.25 v, v pp = 12.5 0.3 v, v ss = 0 v, ta = 25 5?c) item pins symbol min typ max unit test conditions input high voltage i/o7 i/o0, a16 a0, oe ce pgm v cc + 0.3 v input low voltage i/o7 i/o0, a16 a0, oe ce pgm 0.3 0.8 v output high voltage i/o7 i/o0 v oh 2.4 vi oh = -200 i/o0 v ol 0.45 v i ol = 1.6 ma input leakage current i/o7 i/o0, a16 a0, oe ce pgm 2 40 ma v pp current i pp 40 ma
454 table 17.4 ac characteristics (v cc = 6.0 v 0.25 v, v pp = 12.5 0.3 v, v ss = 0 v, ta = 25 5?c) item symbol min typ max unit test conditions address setup time t as 2 oe 130 ns v pp setup time t vps 2 pgm pgm 5.25 ms v cc setup time t vcs 2 ce 150 ns notes: * 1 input pulse level: 0.45 2.4 v input rise, fall time
455 address data v pp v cc ce pgm oe figure 17.5 write/verify timing 17.3.3 notes on writing 1. always write using the prescribed voltage and timing. the write voltage (programming voltage) v pp is 12.5 v (when the eprom programmer is set to the hitachi specifications for hn27c101, v pp is 12.5 v.) applying a voltage in excess of the rated voltage may damage the device. pay particular attention to overshoot in the eprom programmer. 2. before programming, always check that the index marks on the eprom programmer socket, socket adapter, and device are aligned with each other. if they are not correctly aligned, an overcurrent may be generated, damaging the device. 3. do not touch the socket adapter or device during writing. contact can cause malfunctions that will prevent data from being written accurately.
456 4. page programming mode cannot be used. always set the equipment to byte programming mode. 5. the capacity of the on-chip rom is 64 kbytes, so the data of prom programmer addresses h'10000 h'1ffff should be h'ff. always set the range for prom addresses to h'0000 h'ffff. 6. when write errors occur on consecutive addresses, stop writing. check to see if there are any abnormalities in the eprom programmer and socket adapter. 17.3.4 reliability after writing after programming, it is recommended that the device be left to stand at a high temperature to increase the reliability of data retention. letting it stand at a high temperature is a type of screening method that can eliminate of initial data retention defects of the on-chip prom's memory cells within a short period of time. figure 17.6 shows the flow from programming of the on-chip prom, including screening, to mounting on the device board. writing and verification of program mount on board flowchart from figure 17.4 let stand in nonconductive, high temperature environment (125 150 48 hours) data read and verification (v cc = 5.0 v) figure 17.6 screening flow if abnormalities are found when the program is written and verified or the program is read and checked after writing/verification or letting the chip stand at high temperature, contact hitachi's engineering department.
457 section 18 ram 18.1 overview the sh7032 microcomputer has 8-kbytes of on-chip ram; the sh7034 has 4 kbytes. the on-chip ram is linked to the cpu and direct memory access controller (dmac) with a 32-bit data bus (figure 18.1). the cpu can access data in the on-chip ram in byte, word, or longword units. the dmac can access byte or word data. on-chip ram data can always be accessed in one state, making the ram ideal for use as a program area, stack area, or data area, which require high- speed access. the contents of the on-chip ram are held in both the sleep and standby modes. memory area 7 addresses h'fffe000 to h'fffffff are allocated to the on-chip ram in the sh7032. in the sh7034, addresses h'ffff000 to h'fffffff are allocated.
458 h'fffe000 h'fffe004 h'fffe001 h'fffe005 h'fffe002 h'fffe006 h'fffe003 h'fffe007 h'ffffffc h'ffffffd h'ffffffe h'ffffff on-chip ram internal data bus (32 bits) h'ffff000 h'ffff004 h'ffff001 h'ffff005 h'ffff002 h'ffff006 h'ffff003 h'ffff007 h'ffffffc h'ffffffd h'ffffffe h'fffffff on-chip ram internal data bus (32 bits) sh7032 sh7034 note: addresses in the figure are the lowest shadow addresses in on-chip ram space. note: addresses in the figure are the lowest shadow addresses in on-chip ram space. figure 18.1 block diagram of ram 18.2 operation accesses to addresses h'fffe000?'fffffff (sh7032) or addresses h'ffff000?'fffffff (sh7034) are directed to the on-chip ram. memory area 7 (h'f000000?'fffffff) is divided into shadows in 8 kbyte units for the sh7032 and 4-kbyte units for the sh7034. all shadow accesses are on-chip ram accesses. for more information on shadows, see section 8, bus state controller (bsc).
459 section 19 power-down state 19.1 overview in the power-down state, all cpu functions are halted. this lowers power consumption of the sh microprocessor dramatically. 19.1.1 power-down modes the power-down state includes the following two modes: 1. sleep mode 2. standby mode sleep mode and standby mode are entered from the program execution state according to the transition conditions given in table 19.1. table 19.1 also describes procedures for exiting each mode and the states of the cpu and supporting functions. table 19.1 power-down state state mode entering procedure clock cpu supporting functions cpu registers ram i/o ports exiting procedure sleep mode execute sleep instruction with sby bit set to 0 in sbycr runs halted run held held held interrupt dma address error power-on reset manual reset standby mode execute sleep instruction with sby bit set to 1 in sbycr halted halted halted * 1 held held held or high-z * 2 nmi interrupt power-on reset manual reset sbycr: standby control register sby: standby bit notes: * 1 some of the registers of the on-chip supporting modules are not initialized in standby mode. for details, see table 19.3, register states in standby mode, in section 19.4.1, transition to standby mode, or the descriptions of registers given where the on-chip supporting modules are covered. * 2 the status of i/o ports in standby mode are set by the port high-impedance bit (hiz) in sbycr. see section 19.2, standby control register (sbycr), for details. the status of pins other than the i/o ports are described in appendix b, pin states.
460 19.1.2 register table 19.2 summarizes the register related to the power-down state. table 19.2 standby control register (sbycr) name abbreviation r/w initial value address * access size standby control register sbycr r/w h'1f h'5ffffbc 8, 16, 32 note: * only the values of bits a27?24 and a8?0 are valid; bits a23?9 are ignored. for details on the register addresses, see section 8.3.5, area descriptions. 19.2 standby control register (sbycr) the standby control register (sbycr) is an 8-bit read/write register. it is used to enter standby mode and also sets the port states in standby mode. sbycr is initialized to h'1f by a reset. bit: 7 6 5 4 3 2 1 0 bit name: sby hiz initial value: 0 0 0 1 1 1 1 1 r/w: r/w r/w ? bit 7 (standby (sby)): sby enables transition to standby mode. the sby bit cannot be set to 1 while the timer enable bit (bit tme) in timer control/status register tcsr of the watchdog timer (wdt) is set to 1. to enter standby mode, clear the tme bit to 0 to halt the wdt and then set the sby bit. sby description 0 executing sleep instruction puts the chip into sleep mode (initial value) 1 executing sleep instruction puts the chip into standby mode ? bit 6 (port high-impedance (hiz)): hiz selects whether i/o ports remain in their previous states during standby, or are placed in the high-impedance state when standby mode is entered. the hiz bit cannot be set to 1 while the tme bit is set to 1. to place the pins of the i/o ports in high impedance, clear the tme bit to 0 before setting the hiz bit. hiz description 0 port states are maintained during standby (initial value) 1 ports are placed in the high-impedance state in standby ? bits 5? (reserved): bit 5 is a read-only bit that is always read as 0. only write 0 in bit 5. writing to bits 4? is disabled. these bits are always read as 1.
461 19.3 sleep mode 19.3.1 transition to sleep mode execution of the sleep instruction when the standby bit (sby) in the standby control register (sbycr) is cleared to 0 causes a transition from the program execution state to sleep mode. although the cpu halts immediately after executing the sleep instruction, the contents of its internal registers remain unchanged. the on-chip supporting modules do not halt in sleep mode. 19.3.2 exiting sleep mode sleep mode is exited by an interrupt, dma address error, power-on reset, or manual reset. exit by interrupt: when an interrupt occurs, sleep mode is exited and interrupt exception handling is executed. sleep mode is not exited if the interrupt cannot be accepted because its priority level is equal to or less than the mask level set in the cpu? status register (sr). likewise, sleep mode is not exited if the interrupt is disabled by the on-chip supporting module. exit by dma address error: if the dmac operates during sleep mode and a dma address error occurs, sleep mode is exited and dma address error exception handling is executed. exit by power-on reset: if the res signal goes low while the nmi signal is high, sleep mode is exited and the power-on reset state is entered. if the nmi signal is brought from low to high in order to set the chip for a power-on reset, an nmi interrupt will occur whenever the rising edge of nmi is selected as the valid edge (with nmi edge select bit nmie in the interrupt control register (icr) of the interrupt controller). when this occurs, the nmi interrupt clears sleep mode. exit by manual reset: if the res signal goes low while the nmi signal is low, sleep mode is exited and the manual reset state is entered. if the nmi signal is brought from high to low in order to set the chip for a manual reset, sleep mode will be exited by an nmi interrupt whenever the falling edge of nmi is selected as the valid edge (with the nmie bit). 19.4 standby mode 19.4.1 transition to standby mode to enter standby mode, set the standby bit (sby) to 1 in the standby control register (sbycr), then execute the sleep instruction. the chip switches from the program execution state to standby mode. standby mode greatly reduces power consumption by halting not only the cpu, but the clock and on-chip supporting modules as well. some registers of the on-chip supporting modules are initialized, others are not (see table 19.3). as long as the specified voltage is supplied, however, cpu register contents and on-chip ram data are held. the i/o port state (hold
462 or high impedance) depends on the port high-impedance bit (hiz) in sbycr. for details on the states of these pins, see appendix b, pin states. table 19.3 register states in standby mode module registers initialized registers that hold data interrupt controller (intc) all registers user break controller (ubc) all registers bus state controller (bsc) all registers pin function controller (pfc) all registers i/o ports all registers direct memory access controller (dmac) all registers watchdog timer (wdt) ? bits 7? (ovf, wt/ it , tme) in timer control status register (tcsr) ? reset control/status register (rstcsr) ? bits 2? (cks2?ks0) in timer control status register (tcsr) ? timer counter (tcnt) 16-bit integrated timer pulse unit (itu) all registers programmable timing pattern controller (tpc) all registers serial communication interface (sci) ? receive data register (rdr) ? transmit data register (tdr) ? serial mode register (smr) ? serial control register (scr) ? serial status register (ssr) ? bit rate register (bbr) a/d converter (a/d) all registers power-down state register standby control register (sbycr)
463 19.4.2 exiting standby mode standby mode is exited by an nmi interrupt, a power-on reset, or a manual reset. exit by nmi: when a rising edge or falling edge (as selected by the nmie bit in the interrupt control register (icr) of the interrupt controller (intc)) is detected at the nmi pin, the clock oscillator begins operating. at first, clock pulses are supplied only to the watchdog timer. after the time that was selected before entering standby mode using clock select bits 2? (cks2?ks0) in the timer control/status register (tcsr) of the watchdog timer (wdt), the watchdog timer overflows. after the overflow, the clock is considered stable and supplied to the entire chip. standby mode is exited and the nmi exception handling sequence begins. when standby mode is cleared by an nmi interrupt, bits cks2?ks0 must be set so that the wdt overflow interval is equal to or greater than the clock settling time. when standby mode is cleared when the falling edge has been selected with the nmi bit, be sure that the nmi pin is high when standby mode is entered (when the clock is halted) and low when the chip returns from standby mode (clock starts up after the oscillator is stabilized). likewise, when standby mode is cleared when the rising edge has been selected with the nmi bit, be sure that the nmi pin is low when standby mode is entered (clock halted) and high when the chip returns from standby mode (clock starts up after the oscillator is stabilized). exit by power-on reset: if the res signal goes low while the nmi signal is high, standby mode is exited and the power-on reset state is entered. if the nmi signal is brought from low to high in order to set the chip for a power-on reset, standby mode will not be exited by an nmi interrupt, because the nmi signal is initialized for the falling edge in standby mode (by the nmie bit). exit by manual reset: if the res signal goes low while the nmi signal is low, standby mode is exited and the manual reset state is entered. if the nmi signal is brought from high to low in order to set the chip for a manual reset, standby mode will first be exited by an nmi interrupt, because the nmi signal is initialized for the falling edge in standby mode (by the nmie bit). 19.4.3 standby mode application in this example, standby mode is entered on the falling edge of the nmi signal and exited on the rising edge of the nmi signal. figure 19.1 shows the timing. after an nmi interrupt is accepted on a high-to-low transition at the nmi pin while nmi edge select bit nmie in the interrupt control register (icr) is cleared to 0 to select falling edge detection, the nmi exception handling routine sets nmie to 1 (selecting rising edge detection) and sets the sby bit to 1. finally, it executes a sleep instruction to enter standby mode. standby mode is exited on the rising edge of the nmi signal.
464 oscillator ck nmi nmie ssby clock setting time nmi exception handling exception handling routine sby = 1 sleep instruction standby mode oscillation start time time set in wdt nmi exception handling figure 19.1 nmi timing for standby mode (example)
465 section 20 electrical characteristics 20.1 sh7032 and sh7034 electrical characteristics 20.1.1 absolute maximum ratings table 20.1 shows the absolute maximum ratings. table 20.1 absolute maximum ratings item symbol rating unit power supply voltage v cc ?.3 to +7.0 v program voltage v pp ?.3 to +13.5 v input voltage (except port c) v in ?.3 to v cc + 0.3 v input voltage (port c) v in ?.3 to av cc + 0.3 v analog power supply voltage av cc ?.3 to +7.0 v analog reference voltage av ref ?.3 to av cc + 0.3 v analog input voltage v an ?.3 to av cc + 0.3 v operating temperature t opr ?0 to +75 * ?c storage temperature t stg ?5 to +125 ?c caution: operating the chip in excess of the absolute maximum rating may result in permanent damage. note: * regular-specification products; for wide-temperature-range products, t opr = ?0 to +85 c 20.1.2 dc characteristics table 20.2 lists dc characteristics. table 20.3 lists the permissible output current values. usage conditions: ? do not release av cc , av ref and av ss when the a/d converter is not in use. connect av cc and av ref to v cc and av ss to v ss . ? the current consumption value is measured under conditions of v ih min = v cc ?0.5 v and v il max = 0.5 v with no load on any output pin and the on-chip pull-up mos off. ? even when the a/d converter is not used or is in standby mode, connect av cc and av ref to the power voltage(v cc ).
466 table 20.2 dc characteristics conditions: v cc = 5.0 v 10%, av cc = 5.0 v 10%, av cc = v cc 10%, av ref = 4.5 v to av cc , v ss = av ss = 0 v, = 20 mhz, ta = ?0 to +75 c * ) note: * regular-specification products; for wide-temperature-range products, ta = ?0 to +85 c item symbol min typ max unit test conditions input high-level voltage res , nmi, md2?d0 v ih v cc ?0.7 v cc + 0.3 v extal v cc 0.7 v cc + 0.3 v port c 2.2 av cc + 0.3 v other input pins 2.2 v cc + 0.3 v input low-level voltage res , nmi, md2?d0 v il ?.3 0.5 v other input pins ?.3 0.8 v schmidt trigger v t + 4.0 v input voltage v t 1.0 v v t + ? t 0.4 v input leakage current res |iin| 1.0 a vin = 0.5 to v cc 0.5 v nmi, md2?d0 1.0 a vin = 0.5 to v cc 0.5 v port c 1.0 a vin = 0.5 to av cc 0.5 v 3-state leakage current (off state) ports a and b, cs3 cs0 , a21?0, ad15?d0 |i tsi | 1.0 a vin = 0.5 to v cc 0.5 v input pull-up mos current pa3 ?p 20 300 a vin = 0v output high- all output v oh v cc ?0.5 v i oh = ?00 a level voltage pins 3.5 v i oh = ? ma output low all output v ol 0.4 v i ol = 1.6 ma level voltage pins 1.2 v i ol = 8 ma pa13?a10, pa2, pa0, pb7?b0
467 table 20.2 dc characteristics (cont) conditions: v cc = 5.0 v 10%, av cc = 5.0 v 10%, av cc = v cc 10%, av ref = 4.5 v to av cc , v ss = av ss = 0 v, = 20 mhz, ta = ?0 to +75 c * ) note: * regular-specification products; for wide-temperature-range products, ta = ?0 to +85 c item symbol min typ max unit test conditions input res cin 30 pf capacitance nmi 30 pf all other input pins 20 pf current ordinary i cc 60 90 ma f = 12.5 mhz consumption operation 100 130 ma f = 20 mhz sleep 40 70 ma f = 12.5 mhz 60 90 ma f = 20 mhz standby 0.01 5 * 1 a ta 50 c 20.0 * 2 a50 c < ta analog power supply current during a/d conversion ai cc 1.0 2 ma while a/d converter is waiting 0.01 5 a reference power supply during a/d conversion ai ref 0.5 1 ma av ref = 5.0 v current while a/d converter is waiting 0.01 5 a ram standby voltage v ram 2.0 v notes: * 1 50 a for the sh7032. * 2 300 a for the sh7032. vin = 0 v input signal f = 1 mhz ta = 25 c
468 table 20.2 dc characteristics (cont) conditions: v cc = 3.0 v to 5.5 v, av cc = 3.0 to 5.5 v, av cc = v cc 10%, av ref = 3.0 v to av cc , v ss = av ss = 0 v, = 12.5 mhz, ta = ?0 to +75 c * ) note: * regular-specification products; for wide-temperature-range products, ta = ?0 to +85 c item symbol min typ max unit test conditions input high-level voltage res , nmi, md2?d0 v ih v cc 0.9 v cc + 0.3 v extal v cc 0.7 v cc + 0.3 v port c v cc 0.7 av cc + 0.3 v other input pins v cc 0.7 v cc + 0.3 v input low-level voltage res , nmi, md2?d0 v il ?.3 v cc 0.1 v other input pins ?.3 v cc 0.2 v schmidt trigger v t + v cc 0.9 v input voltage v t v cc 0.2 v v t + ? t v cc 0.07 v input leakage current res |iin| 1.0 a vin = 0.5 to v cc 0.5 v nmi, md2?d0 1.0 a vin = 0.5 to v cc 0.5 v port c 1.0 a vin = 0.5 to av cc 0.5 v 3-state leakage current (off state) ports a and b, cs3 cs0 , a21?0, ad15?d0 |i tsi | 1.0 a vin = 0.5 to v cc 0.5 v input pull-up mos current pa3 ?p 20 300 a vin = 0v output high- all output v oh v cc ?0.5 v i oh = ?00 a level voltage pins v cc ?1.0 v i oh = ? ma output low all output v ol 0.4 v i ol = 1.6 ma level voltage pins 1.2 v i ol = 8 ma pa13?0, pa2, pa0, pb7?b0
469 table 20.2 dc characteristics (cont) conditions: v cc = 3.0 v to 5.5 v, av cc = 3.0 to 5.5 v, av cc = v cc 10%, av ref = 3.0 v to av cc , v ss = av ss = 0 v, = 12.5 mhz, ta = ?0 to +75 c * ) note: * regular-specification products; for wide-temperature-range products, ta = ?0 to +85 c item symbol min typ max unit test conditions input res cin 30 pf capacitance nmi 30 pf all other input pins 20 pf current consumption ordinary operation i cc 60 90 ma f = 12.5 mhz sleep 40 70 ma f = 12.5 mhz standby 0.01 5.0 * 1 a ta 50 c 20.0 * 2 a50 c < ta analog power during a/d ai cc 0.5 1.5 ma av cc = 3.0 v supply current conversion 1.0 2.0 ma av cc = 5.0 v while a/d converter is waiting 0.01 5.0 a during a/d ai ref 0.4 0.8 ma av ref = 3.0 v conversion 0.5 1 ma av ref = 5.0 v while a/d converter is waiting 0.01 5.0 a ram standby voltage v ram 2.0 v notes: * 1 50 a for the sh7032. * 2 300 a for the sh7032. vin = 0 v input signal f = 1 mhz ta = 25 c reference power supply current
470 usage notes: 1. if the a/d converter is not used, do not leave the av cc , v ref , and av ss pins open. connect av cc and av ref to v cc , and connect av ss to v ss . 2. current dissipation values are for v ih min = v cc - 0.5 v and v il max = 0.5 v with all output pins unloaded and the on-chip pull-up transistors in the off state. 3. icc depends on v cc and f as follows: i cc max = 1.0 (ma) + 1.29 (ma/mhz ?v) v cc f [ordinary operation] i cc max = 1.0 (ma) + 1.00 (ma/mhz ?v) v cc f [sleep] 4. when the a/d converter is not used, and in standby mode, av cc and av ref must still be connected to the power supply (v cc ). 5. the ztat and mask versions have the same functions, and the electrical characteristics of both are within specification, but characteristic-related performance values, operating margins, noise margins, noise emission, etc., are different. caution is therefore required in carrying out system design, and when switching between ztat and mask versions.
471 table 20.3 permitted output current values case a: v cc = 3.0 to 5.5 v, av cc = 3.0 to 5.5 v, av cc = v cc 10%, av ref = 3.0 v to av cc , v ss = av ss = 0 v, ta = ?0 to +75 c * ) case b: v cc = 5.0 v 10%, av cc = 5.0 v 10%, av cc = v cc 10%, av ref = 4.5 v to av cc , v ss = av ss = 0 v, ta = ?0 to +75 c * ) note: * regular-specification products; for wide-temperature-range products, ta = ?0 to +85 c case a case b 12.5 mhz 20 mhz item symbol min typ max min typ max unit output low-level permissible current (per pin) i ol 10 10 ma output low-level permissible current (total) i ol 80 80 ma output high-level permissible current (per pin) ? oh 2.0 2.0 ma output high-level permissible current (total) i oh 25 25 ma caution: to ensure reliability of the chip, do not exceed the output current values given in table 20.3.
472 20.1.3 ac characteristics the following ac timing chart represents the ac characteristics, not signal functions. for signal functions, see the explanation in the text. ( 1 ) clock timing table 20.4 clock timing case a: v cc = 3.0 to 5.5 v, av cc = 3.0 to 5.5 v, av cc = v cc 10%, av ref = 3.0 v to av cc , v ss = av ss = 0 v, ta = ?0 to +75 c * ) case b: v cc = 5.0 v 10%, av cc = 5.0 v 10%, av cc = v cc 10%, av ref = 4.5 v to av cc , v ss = av ss = 0 v, ta = ?0 to +75 c * ) note: * regular-specification products; for wide-temperature-range products, ta = ?0 to +85 c case a case b sym- 12.5 mhz 20 mhz item bol min max min max unit figures extal input high level pulse width t exh 20 10 ns 20.1 extal input low level pulse width t exl 20 10 ns extal input rise time t exr ?0 5 ns extal input fall time t exf ?0 5 ns clock cycle time t cyc 80 500 50 500 ns 20.1, 20.2 clock high pulse width t ch 30 20 ns 20.2 clock low pulse width t cl 30 20 ns clock rise time t cr ?0 5 ns clock fall time t cf ?0 5 ns reset oscillation settling time t osc1 10 10 ms 20.3 software standby oscillation settling time t osc2 10 10 ms
473 t cyc t exh extal t exl t exf v ih v il t exr 1/2 v cc figure 20.1 extal input timing t cyc t ch t cr ck t cl t cf figure 20.2 system clock timing t osc2 t osc1 ck v cc res figure 20.3 oscillation settling time
474 ( 2 ) control signal timing table 20.5 control signal timing case a: v cc = 3.0 to 5.5 v, av cc = 3.0 to 5.5 v, av cc = v cc 10%, av ref = 3.0 v to av cc , v ss = av ss = 0 v, ta = ?0 to +75 c * ) case b: v cc = 5.0 v 10%, av cc = 5.0 v 10%, av cc = v cc 10%, av ref = 4.5 v to av cc , v ss = av ss = 0 v, ta = ?0 to +75 c * ) note: * regular-specification products; for wide-temperature-range products, ta = ?0 to +85 c case a case b 12.5 mhz 20 mhz item symbol min max min max unit figure res setup time t ress 320 200 ns 20.4 res pulse width t resw 20 20 t cyc nmi reset setup time t nmirs 320 200 ns nmi reset hold time t nmirh 320 200 ns nmi setup time t nmis 160 100 ns 20.5 nmi hold time t nmih 80 50 ns irq0 irq7 setup time (edge detection) t irqes 160 100 ns irq0 irq7 setup time (level detection) t irqls 160 100 ns irq0 irq7 hold time t irqeh 80 50 ns irqout output delay time t irqod 80 50 ns 20.6 bus request setup time t brqs 80 50 ns 20.7 bus acknowledge delay time 1 t bacd1 80 50 ns bus acknowledge delay time 2 t bacd2 80 50 ns bus 3-state delay time t bzd 80 50 ns
475 ck res nmi t ress t ress t nmirs t resw t nmirh figure 20.4 reset input timing irq edge nmi t nmis ck t nmih t irqes t irqeh irq level t irqls figure 20.5 interrupt signal input timing irqout ck t irqod t irqod figure 20.6 interrupt signal output timing
476 t brqs t brqs t bacd1 t bzd t bzd t bacd2 ck breq (input) back (output) a21 a0 rd , wr , ras , cas , csn figure 20.7 bus release timing
477 ( 3 ) bus timing tables 20.6 to 20.8 show the bus timing. table 20.6 bus timing (1) conditions: v cc = 5.0 v 10%, av cc = 5.0 v 10%, av cc = v cc 10%, av ref = 4.5 v to av cc , v ss = av ss = 0 v, = 20 mhz, ta = ?0 to +75 c * note: * regular-specification products; for wide-temperature-range products, ta = ?0 to +85 c item symbol min max unit figures address delay time t ad 20 * 1 ns 20.8, 20.9, 20.11 20.14, 20.19, 20.20 cs delay time 1 t csd1 25 ns 20.8, 20.9, 20.20 cs delay time 2 t csd2 25 ns cs delay time 3 t csd3 20 ns 20.19 cs delay time 4 t csd4 20 ns access time 1 * 6 35% duty * 2 t rdac1 t cyc 0.65 20 ns 20.8, from read strobe 50% duty t cyc 0.5 20 ns access time 2 * 6 from read strobe 35% duty * 2 t rdac2 t cyc (n+1.65) 20 * 3 ns 20.9, 20.10 50% duty t cyc (n+1.5) 20 * 3 ns access time 3 * 6 from read strobe 35% duty * 2 t rdac3 t cyc (n+0.65) 20 * 3 ns 20.19 50% duty t cyc (n+0.5) 20 * 3 ns read strobe delay time t rsd 20 ns 20.8, 20.9, 20.11 20.15, 20.19 read data setup time t rds 15 ns 20.8, 20.9, 20.11 20.14, read data hold time t rdh 0 ns 20.19 write strobe delay time 1 t wsd1 20 ns 20.9, 20.13, 20.14, 20.19, 20.20 write strobe delay time 2 t wsd2 20 ns 20.9, 20.13, 20.14, 20.19 write strobe delay time 3 t wsd3 20 ns 20.11, 20.12 write strobe delay time 4 t wsd4 20 ns 20.11, 20.12, 20.20 write data delay time 1 t wdd1 35 ns 20.9, 20.13, 20.14, 19 write data delay time 2 t wdd2 20 ns 20.11, 20.12
478 table 20.6 bus timing (1) (cont) conditions: v cc = 5.0 v 10%, av cc = 5.0 v 10%,av cc = v cc 10%, av ref = 4.5 v to av cc , v ss = av ss = 0 v, = 20 mhz, ta = ?0 to +75 c * note: * regular-specification products; for wide-temperature-range products, ta = ?0 to +85 c item symbol min max unit figures write data hold time t wdh 0 ns 20.9, 20.11 20.14 parity output delay time 1 t wpdd1 40 ns 20.9, 20.13, 20.14 parity output delay time 2 t wpdd2 20 ns 20.11, 20.12 parity output hold time t wpdh 0 ns 20.9, 20.11 20.14 wait setup time t wts 14 ns 20.10, 20.15, 20.19 wait hold time t wth 10 ns read data access time 1 * 6 t acc1 t cyc 30 * 4 ns 20.8, 20.11, 20.12 read data access time 2 * 6 t acc2 t cyc (n+2) 30 * 3 ns 20.9, 20.10, 20.13 20.15 ras delay time 1 t rasd1 20 ns 20.11 20.14, ras delay time 2 t rasd2 30 ns 20.16 20.18 cas delay time 1 t casd1 20 ns 20.11 cas delay time 2 * 7 t casd2 20 ns 20.13, 20.14, cas delay time 3 * 7 t casd3 20 ns 20.16 20.18 column address setup time t asc 0 ns 20.11, 20.12 read data access time from cas 1 * 6 35% duty * 2 t cac1 t cyc 0.65 19 ns 50% duty t cyc 0.5 19 ns read data access time from cas 2 * 6 t cac2 t cyc (n+1) 25 * 3 ns 20.13 20.15 read data access time from ras 1 * 6 t rac1 t cyc 1.5 20 ns 20.11, 20.12 read data access time from ras 2 * 6 t rac2 t cyc (n+2.5) 20 * 3 ns 20.13 20.15 high-speed page mode cas precharge time t cp t cyc 0.25 ns 20.12
479 table 20.6 bus timing (1) (cont) conditions: v cc = 5.0 v 10%, av cc = 5.0 v 10%, av cc = v cc 10%, av ref = 4.5 v to av cc , v ss = av ss = 0 v, = 20 mhz, ta = ?0 to +75 c * note: * regular-specification products; for wide-temperature-range products, ta = ?0 to +85 c item symbol min max unit figures ah delay time 1 t ahd1 20 ns 20.19 ah delay time 2 t ahd2 20 ns multiplexed address delay time t mad 30 ns multiplexed address hold time t mah 0 ns dack0, dack1 delay time 1 t dacd1 23 ns 20.8, 20.9, 20.11 20.14, 20.19, 20.20 dack0, dack1 delay time 2 t dacd2 23 ns dack0, dack1 delay time 3 * 7 t dacd3 20 ns 20.9, 20.13, 20.14, 20.19 dack0, dack1 delay time 4 t dacd4 20 ns 20.11, 20.12 dack0, dack1 delay time 5 t dacd5 20 ns read delay time 35% duty * 2 t rdd t cyc 0.35 + 12 ns 20.8, 20.9, 20.11 50% duty t cyc 0.5 + 15 ns 20.15, 20.19 data setup time for cas t ds 0 * 5 ns 20.11, 20.13 cas setup time for ras t csr 10 ns 20.16 20.18 row address hold time t rah 10 ns 20.11, 20.13 write command hold time t wch 15 ns write command 35% duty * 2 t wcs 0 ns 20.11 setup time 50% duty t wcs 0 ns access time from cas precharge * 6 t acp t cyc ? 20 ns 20.12 notes: * 1 hbs and lbs signals are 25 ns. * 2 when frequency is 10 mhz or more. * 3 n is the number of wait cycles. * 4 access time from addresses a0 to a21 is tcyc-25 ns. * 5 5ns for parity output of dram long-pitch access. * 6 it is not necessary to meet the t rds specification as long as the access time specification is met. * 7 in the relationship of t casd2 and t casd3 with respect to t dacd3 , a min-max combination does not occur because of the logic structure.
480 ck a21 a0 hbs , lbs csn dack0 rd (read) dack1 ad15 ad0 dph, dpl (read) t 1 t ad t csd1 t csd2 t rsd t rdac1 * 1 t acc1 * 2 t rds t rdh * 3 t dacd1 t dacd2 t rdd notes: * 1 for t rdac1 , use t cyc 0.65 20 (for 35% duty) or t cyc 0.5 20 (for 50% duty) instead of t cyc t rdd t rds . * 2 for t acc1 , use t cyc 30 instead of t cyc t ad (or t csd1 ) t rds . * 3t rdh is measured from a21 a0, csn , or rd , whichever is negated first. figure 20.8 basic bus cycle: one-state access
481 t 1 t 2 t ad t rdd t csd2 t rsd t rdac2 * 1 t acc2 * 2 t rds t rdh * 3 t dacd2 t dacd1 t wsd2 t wsd1 t dacd3 t dacd3 t wdh t wdd1 t wpdh t wpdd1 ck a21 a0 hbs , lbs csn dack0 dack1 (read) rd (read) wrh , wrl , wr (write) ad15 ad0 dph, dpl (read) ad15 ad0 (write) dph, dpl (write) dack0 dack1 (write) t csd1 notes: * 1 for t rdac2 , use t cyc (n + 1.65) 20 (for 35% duty) or t cyc (n + 1.5) 20 (for 50% duty) instead of t cyc (n + 2) t rdd t rds . * 2 for t acc2 , use t cyc (n + 2) 30 instead of t cyc (n + 2) t ad (or t csd1 ) t rdh . * 3t rdh is measured from a21 a0, csn , or rd , whichever is negated first. figure 20.9 basic bus cycle: two-state access
482 dack0 dack1 (read) rd (read) csn ad15 ad0 dph, dpl (read) a21 a0 hbs , lbs dack0 dack1 (write) ck wait ad15 ad0 dph, dpl (write) wrh , wrl , wr (write) t 1 t w t 2 t wts t wth t wts t wth t rdac2 * 1 t acc2 * 2 notes: * 1 for t rdac2 , use t cyc (n+1.65) 20 (for 35% duty) or t cyc (n+1.5) 20 (for 50% duty) instead of t cyc (n+2) t rdd t rds . * 2 for t acc2 , use t cyc (n+2) 30 instead of t cyc (n+2) t ad (or t csd1 ) t rds . figure 20.10 basic bus cycle: two states + wait state
483 ck a21 a0 ras cas wrh , wrl , wr (read) dack0 dack1 (read) ad15 ad0 dph, dpl (read) wrh , wrl , wr (write) ad15 ad0 (write) dph, dpl (write) dack0 dack1 (write) t p t r t c t ad t ad t rasd1 t rasd2 t casd1 t dacd1 t cac1 * 1 t rds t rdh * 4 t wsd3 t wdd2 t wdh t wpdd2 t wpdh t dacd4 t dacd5 t acc1 * 2 t rah t dacd2 t wsd4 t wch t asc t ds row column t wcs t rac1 * 3 rd (write) rd (read) t rsd t rdd notes: * 1 for t cac1 , use t cyc 0.65 19 (for 35% duty) or t cyc 0.5 19 (for 50% duty) instead of t cyc t ad t asc t rds . * 2 for t acc1 , use t cyc 30 instead of t cyc t ad t rds . * 3 for t rac1 , use t cyc 1.5 20 instead of t cyc 1.5 t rasd1 t rds . * 4t rdh is measured from a21 a0, ras , or cas , whichever is negated first. figure 20.11 dram bus cycle (short-pitch, normal mode)
484 ck a21 a0 ras cas wrh , wrl , wr (read) dack0 dack1 (read) ad15 ad0 dph, dpl (read) t ad t p t r t c t c t c t ad t rasd1 t rasd2 t cp t asc t rdh * 5 t rac1 * 3 t dacd1 t dacd2 column address column address column address t cac1 * 1 t c t acc1 * 2 t rds rd (read) t rdd t acp t rsd t rdh * 4 row address column address notes: * 1 for t cac1 , use t cyc 0.65 19 (for 35% duty) or t cyc x 0.5 19 (for 50% duty) instead of t cyc t ad t asc t rds . it is not necessary to meet the t rds specification as long as the t cac1 specification is met. * 2 for t acc1 , use t cyc 30 instead of t cyc t ad t rds . it is not necessary to meet the t rds specification as long as the t acc1 specification is met. * 3 for t rac1 , use t cyc 1.5 20 instead of t cyc 1.5 t rasd1 t rds . it is not necessary to meet the t rds specification as long as the t rac1 specification is met. * 4t rdh is measured from a21 a0 or cas , whichever is negated first. * 5t rdh is measured from a21 a0, ras , or cas , whichever is negated first. figure 20.12 (a) dram bus cycle (short-pitch, high-speed page mode: read)
485 ck a21 a0 ras cas wrh , wrl , wr (write) dack0 dack1 (write) ad15 ad0 dph, dpl (write) dph, dpl (write) t ad t p t r t c silent cycle t c t ad t rasd1 t rasd2 t asc t dacd4 t dacd5 t dacd5 rd (write) t wsd4 t wsd3 t wdd2 t wdh t wpdd2 t wpdh column address column address row address figure 20.12 (b) dram bus cycle (short-pitch, high-speed page mode: write) note: for details of the silent cycle, see section 8.5.5, dram burst mode.
486 ck a21 a0 ras cas wrh , wrl , wr (read) dack0 dack1 (read) ad15 ad0 dph, dpl (read) wrh , wrl , wr (write) ad15 ad0 (write) t ad t p t r t c1 t c2 t ad t rasd1 t rasd2 dack0 dack1 (write) dph, dpl (write) column t casd3 t acc2 * 2 t rdh * 4 t dacd1 t dacd2 t wsd1 t wsd2 t wdd1 t wdh t wpdh t wpdd1 t dacd3 t dacd3 t rac2 * 3 t ds t casd2 t wch t cac2 * 1 rd (write) rd (read) t rdd t rsd row t rah t rds notes: * 1 for t cac2 , use t cyc (n + 1) 25 instead of t cyc (n + 1) t casd2 t rds . * 2 for t acc2 , use t cyc (n + 2) 30 instead of t cyc (n + 2) t ad t rds . * 3 for t rac2 , use t cyc (n + 2.5) 20 instead of t cyc (n + 2.5) t rasd1 t rds . * 4t rdh is measured from a21 a0, cas , or ras , whichever is negated first. figure 20.13 dram bus cycle: (long-pitch, normal mode)
487 ck a21 a0 ras cas wrh , wrl , wr (read) dack0 dack1 (read) ad15 ad0 dph, dpl (read) wrh , wrl , wr (write) ad15 ad0 (write) dack0 dack1 (write) dph, dpl (write) t p t r t c1 t c2 t c1 t c2 t ad t ad t rasd1 t rasd2 t casd3 t casd2 t rdh * 5 t casd3 t rdh * 4 t rac2 * 3 t acc2 * 2 t cac2 * 1 t rds t dacd1 t dacd1 t dacd2 t dacd2 t wsd1 t wsd1 t wsd2 t wsd2 t wdd1 t wdh t wdd1 t wdh t wpdd1 t wpdd1 t wpdh t wpdh t dacd3 t dacd3 t dacd3 t dacd3 column column rd (write) rd (read) t rdd t rsd row notes: * 1 for t cac2 , use t cyc (n + 1) 25 instead of t cyc (n + 1) t casd2 t rds . * 2 for t acc2 , use t cyc (n + 2) 30 instead of t cyc (n + 2) t ad t rds . * 3 for t rac2 , use t cyc (n + 2.5) 20 instead of t cyc (n + 2.5) t rasd2 t rds . * 4t rdh is measured from a21 a0 or cas , whichever is negated first. * 5t rdh is measured from a21 a0, ras , or cas whichever is negated first. figure 20.14 dram bus cycle: (long-pitch, high-speed page mode)
488 ck a21 a0 ras cas wrh , wrl , wr (read) dack0 dack1 (read) ad15 ad0 dph, dpl (read) wrh , wrl , wr (write) ad15 ad0 (write) dack0 dack1 (write) dph, dpl (write) wait t p t r t c1 t w t c2 row column t wts t wth t wts t wth t acc2 * 2 t rac2 * 3 t cac2 * 1 rd (write) rd (read) t rsd t rdd notes: * 1 for t cac2 , use t cyc (n + 1) 25 instead of t cyc (n + 1) t casd2 t rds . * 2 for t acc2 , use t cyc (n + 2) 30 instead of t cyc (n + 2) t ad t rds . * 3 for t rac2 , use t cyc (n + 2.5) 20 instead of t cyc (n + 2.5) t rasd1 t rds . figure 20.15 dram bus cycle: (long-pitch, high-speed page mode + wait state)
489 ck ras cas wrh , wrl , wr t rp t rr t rc t rasd1 t rasd2 t casd3 t casd2 t csr figure 20.16 cas-before-ras refresh (short-pitch) ck ras cas wrh , wrl , wr t rp t rc t rc t rasd1 t rasd2 t casd3 t casd2 t rr t csr figure 20.17 cas-before-ras refresh (long-pitch)
490 ck ras cas t rp t rc t rcc t rasd1 t rasd2 t casd3 t casd2 t rr t csr figure 20.18 self-refresh
491 ck a21 a0 hbs , lbs cs6 ah rd (read) dack0 dack1 (read) ad15 ad0 (read) wrh , wrl , wr (write) ad15 ad0 (write) dack0 dack1 (write) wait t 1 t 2 t 3 t 4 t csd4 t csd3 t ad t ahd1 t ahd2 t rsd t rdh t mah t mad t rdac3 t dacd2 t dacd1 t wsd1 t wsd2 t mad t mah t wdd1 t dacd3 t dacd3 t wth t wts address address data (output) t rdd t wdh data (input) figure 20.19 address/data multiplex i/o bus cycle
492 ck a21 a0 hbs , lbs csn dack0 dack1 (write) wrh , wrl , wr (write) t 1 t ad t csd1 t csd2 t wsd4 t dacd1 t dacd2 t wsd1 figure 20.20 dma single transfer/one-state access write
493 table 20.7 bus timing (2) conditions: v cc = 3.0 to 5.5 v, av cc = 3.0 to 5.5 v, av cc = v cc 20 to +75 40 to +85 item symbol min max unit figures address delay time t ad 40 ns 20.21, 20.22, 20.24 20.27, 20.32, 20.33 cs delay time 1 t csd1 40 ns 20.21, 20.22, 20.33 cs delay time 2 t csd2 40 ns cs delay time 3 t csd3 40 ns 20.32 cs delay time 4 t csd4 40 ns access time 1 * 4 35% duty * 1 t rdac1 t cyc 0.65 35 ns 20.21, from read strobe 50% duty t cyc 0.5 35 ns access time 2 * 4 35% duty * 1 t rdac2 t cyc (n+1.65) 35 * 2 ns 20.22, 20.23 from read strobe 50% duty t cyc (n+1.5) 35 * 2 ns access time 3 * 4 35% duty * 1 t rdac3 t cyc (n+0.65) 35 * 2 ns 20.32 from read strobe 50% duty t cyc (n+0.5) 35 * 2 ns read strobe delay time t rsd 40 ns 20.21, 20.22, 20.24 20.28, 20.32 read data setup time t rds 25 ns 20.21, 20.22, read data hold time t rdh 0 ns 20.24-20.27, 20.32 write strobe delay time 1 t wsd1 40 ns 20.22, 20.26, 20.27, 20.32, 20.33 write strobe delay time 2 t wsd2 30 ns 20.22, 20.26, 20.27, 20.32 write strobe delay time 3 t wsd3 40 ns 20.24, 20.25 write strobe delay time 4 t wsd4 40 ns 20.24, 20.25, 20.33 write data delay time 1 t wdd1 70 ns 20.22, 20.26, 20.27, 20.32 write data delay time 2 t wdd2 40 ns 20.24, 20.26 write data hold time t wdh 10 ns 20.22, 20.24 20.27, 20.32 parity output delay time 1 t wpdd1 80 ns 20.22, 20.24, 20.27 parity output delay time 2 t wpdd2 40 ns 20.24, 20.25 parity output hold time t wpdh 10 ns 20.22, 20.23 20.27
494 table 20.7 bus timing (2) (cont) conditions: v cc = 3.0 to 5.5 v, av cc = 3.0 to 5.5 v, av cc = v cc 20 to +75 40 to +85 item symbol min max unit figures wait setup time t wts 40 ns 20.23, 20.28, 20.32 wait hold time t wth 10 ns read data access time 1 * 4 t acc1 t cyc 44 ns 20.21, 20.24, 20.25 read data access time 2 * 4 t acc2 t cyc (n+2) 44 * 2 ns 20.22, 20.23, 20.26 20.28 ras delay time 1 t rasd1 40 ns 20.24 20.27, 20.29 ras delay time 2 t rasd2 40 ns 20.31 cas delay time 1 t casd1 40 ns 20.24 cas delay time 2 * 5 t casd2 40 ns 20.26, 20.27, 20.29 cas delay time 3 * 5 t casd3 40 ns 20.31 column address setup time t asc 0 ns 20.24, 20.25 read data 35% duty * 1 t cac1 t cyc 0.65 35 ns access time from cas 1 * 4 50% duty t cyc 0.5 35 ns read data access time from cas 2 * 4 t cac2 t cyc (n+1) 35 * 2 ns 20.26 20.28 read data access time from ras 1 * 4 t rac1 t cyc 1.5 35 ns 20.24, 20.25 read data access time from ras 2 * 4 t rac2 t cyc (n+2.5) 35 * 2 ns 20.26 20.28 high-speed page mode cas precharge time t cp t cyc 0.25 ns 20.25 ah delay time 1 t ahd1 40 ns 20.32 ah delay time 2 t ahd2 40 ns multiplexed address delay time t mad 40 ns multiplexed address hold time t mah 10 ns
495 table 20.7 bus timing (2) (cont) conditions: v cc = 3.0 to 5.5 v, av cc = 3.0 to 5.5 v, v cc = av cc 20 to +75 * regular-specification products; for wide-temperature-range products, ta = 40 to +85 item symbol min max unit figures dack0, dack1 delay time 1 t dacd1 40 ns 20.21, 20.22, 20.24 dack0, dack1 delay time 2 t dacd2 40 ns 20.27, 20.32, 20.33 dack0, dack1 delay time 3 * 5 t dacd3 40 ns 20.22, 20.26, 20.27, 20.32 dack0, dack1 delay time 4 t dacd4 40 ns 20.24, 20.25 dack0, dack1 delay time 5 t dacd5 40 ns read delay time 35% duty * 1 t rdd t cyc 0.35 + 35 ns 20.21, 20.22, 20.24- 50% duty t cyc 0.5 + 35 ns 20.28, 20.32 data setup time for cas t ds 0 * 3 ns 20.24, 20.26 cas setup time for ras t csr 10 ns 20.29 20.31 row address hold time t rah 10 ns 20.24, 20.26 write command hold time t wch 15 ns write command 35% duty * 1 t wcs 0 ns 20.24 setup time 50% duty t wcs 0 ns access time from cas precharge * 4 t acp tcyc 20 ns 20.25 notes: * 1 when frequency is 10 mhz or more. * 2 n is the number of wait cycles. * 3 5 ns for parity output of dram long-pitch access * 4 it is not necessary to meet the t rds specification as long as the access time specification is met. * 5 in the relationship of t casd2 and t casd3 with respect to t dacd3 , a min-max combination does not occur because of the logic structure.
496 ck a21 a0 hbs , lbs csn dack0 rd (read) dack1 ad15 ad0 dph, dpl (read) t 1 t ad t csd1 t csd2 t rsd t rdac1 * 1 t acc1 * 2 t rds t rdh * 3 t dacd1 t dacd2 t rdd notes: * 1 for t rdac1 , use t cyc 0.65 35 (for 35% duty) or t cyc 0.5 35 (for 50% duty) instead of t cyc t rdd t rds . * 2 for t acc1 , use t cyc 44 instead of t cyc t ad (or t csd1 ) t rds . * 3t rdh is measured from a21 a0, csn , or rd , whichever is negated first. figure 20.21 basic bus cycle: one-state access
497 t 1 t 2 t ad t rdd t csd2 t rsd t rdac2 * 1 t acc2 * 2 t rds t rdh * 3 t dacd2 t dacd1 t wsd2 t wsd1 t dacd3 t dacd3 t wdh t wdd1 t wpdh t wpdd1 ck a21 a0 hbs , lbs csn dack0 dack1 (read) rd (read) wrh , wrl , wr (write) ad15 ad0 dph, dpl (read) ad15 ad0 (write) dph, dpl (write) dack0 dack1 (write) t csd1 notes: * 1 for t rdac2 , use t cyc (n + 1.65) 35 (for 35% duty) or t cyc (n + 1.5) 35 (for 50% duty) instead of t cyc (n + 2) t rdd t rds . * 2 for t acc2 , use t cyc (n + 2) 44 instead of t cyc (n + 2) t ad (or t csd1 ) t rds480 . * 3t rdh is measured from a21 a0, csn , or rd , whichever is negated first. figure 20.22 basic bus cycle: two-state access
498 dack0 dack1 (read) rd (read) csn ad15 ad0 dph, dpl (read) a21 a0 hbs , lbs dack0 dack1 (write) ck wait ad15 ad0 dph, dpl (write) wrh , wrl , wr (write) t 1 t w t 2 t wts t wth t wts t wth t rdac2 * 1 t acc2 * 2 notes: * 1 for t rdac2 , use t cyc (n + 1.65) 35 (for 35% duty) or t cyc (n + 1.5) 35 (for 50% duty) instead of t cyc (n + 2) t rdd t rds . * 2 for t acc2 , use t cyc (n + 2) 44 instead of t cyc (n + 2) t ad (or t csd1 ) t rds . figure 20.23 basic bus cycle: two states + wait state
499 ck a21 a0 ras cas wrh , wrl , wr (read) dack0 dack1 (read) ad15 ad0 dph, dpl (read) wrh , wrl , wr (write) ad15 ad0 (write) dph, dpl (write) dack0 dack1 (write) t p t r t c t ad t ad t rasd1 t rasd2 t casd1 t dacd1 t cac1 * 1 t rac1 * 3 t rdh * 4 t wsd3 t wsd4 t wdd2 t wdh t wpdd2 t wpdh t dacd4 t dacd5 t acc1 * 2 t rah t wcs row column t asc t ds t dacd2 t rds rd (write) rd (read) t rsd t rdd t wch notes: * 1 for t cac1 , use t cyc 0.65 35 (for 35% duty) or tcyc 0.5 35 (for 50% duty) instead of t cyc t ad t asc t rds . * 2 for t acc1 , use t cyc 44 instead of t cyc t ad t rds . * 3 for t rac1 , use t cyc 1.5 35 instead of t cyc 1.5 t rasd1 t rds . * 4t rdh is measured from a21 a0, ras , or cas , whichever is negated first. figure 20.24 dram bus cycle (short-pitch, normal mode)
500 ck a21 a0 ras cas wrh , wrl , wr (read) dack0 dack1 (read) ad15 ad0 dph, dpl (read) t ad t p t r t c t c t c t ad t rasd1 t rasd2 t cp t asc t rdh * 5 t rac1 * 3 t dacd1 t dacd2 row address column address column address column address t cac1 * 1 t c t acc1 * 2 t rds rd (read) t rdd t acp t rsd t rdh * 4 column address notes: * 1 for t cac1 , use t cyc 0.65 35 (for 35% duty) or t cyc 0.5 35 (for 50% duty) instead of t cyc t ad t asc t rds . it is not necessary to meet the t rds specification as long as the t cac1 specification is met. * 2 for t acc1 , use t cyc 44 instead of t cyc t ad t rds . it is not necessary to meet the t rds specification as long as the t acc1 specification is met. * 3 for t rac1 , use t cyc 1.5 35 instead of t cyc 1.5 t rasd1 t rds . it is not necessary to meet the t rds specification as long as the t rac1 specification is met. * 4t rdh is measured from a21 a0 or cas , whichever is negated first. * 5t rdh is measured from a21 a0, ras , or cas , whichever is negated first. figure 20.25 (a) dram bus cycle (short-pitch, high-speed page mode: read)
501 ck a21 a0 ras cas wrh, wrl , wr (write) dack0 dack1 (write) ad15 ad0 dph, dpl (write) dph, dpl (write) t ad t p t r t c silent cycle t c t ad t rasd1 t rasd2 t asc t dacd4 t dacd5 t dacd5 row address column address column address rd (write) t wsd4 t wsd3 t wdd2 t wdh t wpdd2 t wpdh figure 20.25 (b) dram bus cycle (short-pitch, high-speed page mode: write) note: for details of the silent cycle, see section 8.5.5, dram burst mode.
502 ck a21 a0 ras cas wrh , wrl , wr (read) dack0 dack1 (read) ad15 ad0 dph, dpl (read) wrh , wrl , wr (write) ad15 ad0 (write) t ad t p t r tc 1 tc 2 t ad t rasd1 t rasd2 dack0 dack1 (write) dph, dpl (write) column t casd3 t rdh * 4 t rds t dacd1 t dacd2 t wsd1 t wsd2 t wdd1 t wdh t wpdh t wpdd1 t dacd3 t dacd3 t rah t acc2 * 2 t rac2 * 3 t casd2 t ds t cac2 * 1 t wch rd (write) rd (read) t rdd t rsd row notes: * 1 for t cac2 , use t cyc (n + 1) 35 instead of t cyc (n + 1) t casd2 t rds . * 2 for t acc2 , use t cyc (n + 2) 44 instead of t cyc (n + 2) t ad t rds . * 3 for t rac2 , use t cyc (n + 2.5) 35 instead of t cyc (n + 2.5) t rasd1 t rds . * 4t rdh is measured from a21 a0, cas , or ras , whichever is negated first. figure 20.26 dram bus cycle: (long-pitch, normal mode)
503 ck a21 a0 ras cas wrh , wrl , wr (read) dack0 dack1 (read) ad15 ad0 dph, dpl (read) wrh , wrl , wr (write) ad15 ad0 (write) dack0 dack1 (write) dph, dpl (write) t p t r t c1 t c2 t c1 t c2 t ad t ad t rasd2 t casd3 t casd2 t rdh * 5 t casd3 t rdh * 4 t rac2 * 3 t acc2 * 2 t cac2 * 1 t rds t dacd1 t dacd1 t dacd2 t dacd2 t wsd1 t wsd1 t wsd2 t wsd2 t wdd1 t wdh t wdd1 t wdh t wpdd1 t wpdd1 t wpdh t wpdh t dacd3 t dacd3 t dacd3 t dacd3 column column rd (write) rd (read) t rdd t rasd1 row t rsd notes: * 1 for t cac2 , use t cyc (n + 1) 35 instead of t cyc (n + 1) t casd2 t rds . * 2 for t acc2 , use t cyc (n + 2) 44 instead of t cyc (n + 2) t ad t rds . * 3 for t rac2 , use t cyc (n + 2.5) 35 instead of t cyc (n + 2.5) t rasd2 t rds . * 4t rdh is measured from a21 a0 or cas , whichever is negated first. * 5t rdh is measured from a21 a0, ras , or cas whichever is negated first. figure 20.27 dram bus cycle: (long-pitch, high-speed page mode)
504 ck a21 a0 ras cas wrh , wrl , wr (read) dack0 dack1 (read) ad15 ad0 dph, dpl (read) wrh , wrl , wr (write) ad15 ad0 (write) dack0 dack1 (write) dph, dpl (write) wait t p t r t c1 t w t c2 row column t wts t wth t wts t wth t rac2 * 3 t acc2 * 2 t cac2 * 1 rd (write) rd (read) t rsd t rdd notes: * 1 for t cac2 , use t cyc (n + 1) 35 instead of t cyc (n + 1) t casd2 t rds . * 2 for t acc2 , use t cyc (n + 2) 44 instead of t cyc (n + 2) t ad t rds . * 3 for t rac2 , use t cyc (n + 2.5) 35 instead of t cyc (n + 2.5) t rasd1 t rds . figure 20.28 dram bus cycle: (long-pitch, high-speed page mode + wait state)
505 ck ras cas wrh, wrl, wr t rp t rr t rc t rasd1 t rasd2 t casd3 t casd2 t csr figure 20.29 cas-before-ras refresh (short-pitch) ck ras cas wrh, wrl, wr t rp t rc t rc t rasd1 t rasd2 t casd3 t casd2 t rr t csr figure 20.30 cas-before-ras refresh (long-pitch) ck ras cas t rp t rc t rcc t rasd1 t casd3 t casd2 t rr t csr t rasd2 figure 20.31 self-refresh
506 ck a21 a0 hbs , lbs cs6 ah rd (read) dack0 dack1 (read) ad15 ad0 (read) wrh , wrl , wr (write) ad15 ad0 (write) dack0 dack1 (write) wait t 1 t 2 t 3 t 4 t csd4 t csd3 t ad t ahd1 t ahd2 t rsd t rdh t mah t mad t rdac3 t dacd2 t dacd1 t wsd1 t wsd2 t mad t mah t wdd1 t dacd3 t dacd3 t wth t wts address address data (output) t rdd t wdh data (input) figure 20.32 address/data multiplex i/o bus cycle
507 ck a21 a0 hbs , lbs csn dack0 dack1 (write) wrh , wrl , wr (write) t 1 t ad t csd1 t csd2 t wsd4 t dacd1 t dacd2 t wsd1 figure 20.33 dma single transfer/one-state access write ( 4 ) dmac timing table 20.8 dmac timing case a: v cc = 3.0 to 5.5 v, av cc = 3.0 to 5.5 v, av cc = v cc 20 to +75 20 to +75 40 to +85 case a case b 12.5 mhz 20 mhz item symbol min max min max unit figure dreq0 , dreq1 setup time t drqs 80 27 ns 20.34 dreq0 , dreq1 hold time t drqh 30 30 ns dreq0 , dreq1 pulse width t drqw 1.5 1.5 t cyc 20.35
508 t drqs t drqs ck dreq0 , dreq1 level dreq0 , dreq1 edge t drqs t drqh dreq0 , dreq1 level release figure 20.34 dreq0 , dreq1 input timing (1) ck t drqw dreq0 , dreq1 edge figure 20.35 dreq0 , dreq1 input timing (2)
509 ( 5 ) 16-bit integrated timer pulse unit timing table 20.9 16-bit integrated timer pulse unit timing case a: v cc = 3.0 to 5.5 v, av cc = 3.0 to 5.5 v, av cc = v cc 20 to +75 20 to +75 40 to +85 case a case b 12.5 mhz 20 mhz item symbol min max min max unit figure output compare delay time t tocd 100 100 ns 20.36 input capture setup time t tics 50 35 ns timer clock input setup time t tcks 50 50 ns 20.37 timer clock pulse width (single edge) t tckwh/l 1.5 1.5 t cyc timer clock pulse width (both edges) t tckwl/l 2.5 2.5 t cyc t tocd ck t tics output compare * 1 input capture * 2 notes: * 1 tioca0 tioca4, tiocb0 tiocb4, tocxa4, tocxb4 * 2 tioca0 tioca4, tiocb0 tiocb4 figure 20.36 itu input/output timing
510 t tcks ck t tckwh t tckwl t tcks tclka tclkd figure 20.37 itu clock input timing ( 6 ) programmable timing pattern controller and i/o port timing table 20.10 programmable timing pattern controller and i/o port timing case a: v cc = 3.0 to 5.5 v, av cc = 3.0 to 5.5 v, av cc = v cc 20 to +75 20 to +75 40 to +85 cases a and b item symbol min max unit figure port output delay time t pwd 100 ns 20.38 port input hold time t prh 50 ns port input setup time t prs 50 ns
511 t prs ck t pwd ports a c (read) ports a c (write) t 1 t 2 t 3 t prh figure 20.38 programmable timing pattern controller output timing ( 7 ) watchdog timer timing table 20.11 watchdog timer timing case a: v cc = 3.0 to 5.5 v, av cc = 3.0 to 5.5 v, av cc = v cc 20 to +75 20 to +75 40 to +85 cases a and b item symbol min max unit figure wdtovf delay time t wovd 100 ns 20.39 t wovd ck t wovd wdtovf figure 20.39 watchdog timer output timing
512 ( 8 ) serial communication interface timing table 20.12 serial communication interface timing case a: v cc = 3.0 to 5.5 v, av cc = 3.0 to 5.5 v, av cc = v cc 20 to +75 20 to +75 40 to +85 cases a and b item symbol min max unit figure input clock cycle t scyc 4 t cyc 20.40 input clock cycle (synchronous mode) t scyc 6 t cyc input clock pulse width t sckw 0.4 0.6 t scyc input clock rise time t sckr 1.5 t cyc input clock fall time t sckf 1.5 t cyc transmit data delay time (synchronous mode) t txd 100 ns 20.41 receive data setup time (synchronous mode) t rxs 100 ns receive data hold time (synchronous mode) t rxh 100 ns sck0, sck1 t scyc t sckw t sckr t sckf figure 20.40 input clock timing
513 sck0, sck1 t scyc t rxs t txd t rxh txd0, txd1 (transmit data) rxd0, rxd1 (receive data) figure 20.41 sci i/o timing (synchronous mode) ( 9 ) a/d converter timing table 20.13 a/d converter timing case a: v cc = 3.0 to 5.5 v, av cc = 3.0 to 5.5 v, av cc = v cc 20 to +75 20 to +75 40 to +85 cases a and b item symbol min typ max unit figure external trigger input pulse width t trgw 2.0 t cyc 20.42 external trigger input start delay time t trgs 50 ns a/d conversion start delay time cks = 0 t d 10 17 t cyc 20.43 cks = 1 6 9t cyc input sampling time cks = 0 t spl 64 t cyc cks = 1 32 t cyc a/d conversion time cks = 0 t conv 259 266 t cyc cks = 1 131 134 t cyc
514 ck 1 state t trgs t trgw t trgw adtrg input adst figure 20.42 external trigger input timing t spl max. 14 states t d 3 states t conv ck address analog input sampling signal adf figure 20.43 analog conversion timing
515 ( 10 ) ac characteristics test conditions v v ref i oh c l device under test output microcomputer output pin i ol c l is set as follows for each pin. 30pf: ck, cash , casl , cs0 cs7 , breq , back , ah , irqout , ras , dack0, dack1 50pf: a21 a0, ad15 ad0, dph, dpl, rd , wrh , wrl , hbs , lbs , wr 70pf: all port outputs and supporting module output pins other than the above. i ol and i oh values are as shown in section 20.1.2, dc characteristics, and table 20.3, permitted output current values. figure 20.44 output load circuit
516 20.1.4 a/d converter characteristics table 20.14 a/d converter characteristics conditions: v cc = 5.0 v 20 to +75 40 to +85 12.5 mhz 20 mhz item min typ max min typ max unit resolution 10 10 10 10 10 10 bit conversion time 11.2 6.7 s analog input capacitance 20 20 pf permissible signal-source impedance 3 3k ? nonlinearity error 3 3 lsb offset error 3 3 lsb full-scale error 3 3 lsb quantization error 0.5 0.5 lsb absolute accuracy 4 4 lsb table 20.14 a/d converter characteristics (cont) conditions: v cc = 3.0 to 5.5 v, av cc = 3.0 to 5.5 v, av cc = v cc 20 to +75 40 to +85 12.5 mhz item min typ max unit resolution 10 10 10 bit conversion time 11.2 s analog input capacitance 20 pf permissible signal-source impedance 3k ? nonlinearity error 4.0 lsb offset error 4.0 lsb full-scale error 4.0 lsb quantization error 0.5 lsb absolute accuracy 6.0 lsb
517 20.2 sh7034b 3.3 v 12.5 mhz version and 20 mhz version * 1 electrical characteristics 20.2.1 absolute maximum ratings table 20.15 shows the absolute maximum ratings. table 20.15 absolute maximum ratings item symbol rating unit power supply voltage v cc 0.3 to +4.6 v input voltage (except port c) v in 0.3 to v cc + 0.3 v input voltage (port c) v in 0.3 to av cc + 0.3 v analog power supply voltage av cc 0.3 to +4.6 v analog reference voltage av ref 0.3 to av cc + 0.3 v analog input voltage v an 0.3 to av cc + 0.3 v operating temperature t opr 20 to +75 * 2 ? c storage temperature t stg 55 to +125 ? c caution: operating the chip in excess of the absolute maximum rating may result in permanent damage. notes: * 1 romless products only for 20 mhz version * 2 regular-specification products; for wide-temperature-range products, topr = 40 to +85 c 20.2.2 dc characteristics table 20.16 lists dc characteristics. table 20.18 lists the permissible output current values. usage conditions: ? ? 0.5 v and v il max = 0.5 v with no load on any output pin and the on-chip pull-up mos off. ?
518 table 20.16 dc characteristics conditions: v cc = 3.3 v 20 to +75 40 to +85 item symbol min typ max unit test conditions input high-level voltage extal v ih v cc 0.9 v cc + 0.3 v port c v cc 0.7 av cc + 0.3 v other input pins v cc 0.7 v cc + 0.3 v input low-level voltage other schmidt trigger input pins v il 0.3 v cc 0.2 v schmidt trigger v t + v cc 0.9 v input voltage v t v cc 0.1 v v t + v t v cc 0.07 v input leakage current res |iin| 1.0 a vin = 0.5 to v cc 0.5 v nmi, md2 md0 1.0 a vin = 0.5 to v cc 0.5 v port c 1.0 a vin = 0.5 to av cc 0.5 v 3-state leakage current (off state) ports a and b, cs3 cs0 , a21 a0, ad15 ad0 |i tsi | 1.0 a vin = 0.5 to v cc 0.5 v input pull-up mos current pa3 ip 20 300 a vin = 0v output high- all output v oh v cc 0.7 vi oh = 200 a level voltage pins v cc 1.0 vi oh = 1 ma output low all output v ol 0.4 v i ol = 1.6 ma level voltage pins 1.2 v i ol = 8 ma res , nmi, md2 md0, pa13 10, pa2, pa0, pb7 pb0
519 table 20.16 dc characteristics (cont) conditions: v cc = 3.3 v 20 to +75 40 to +85 item symbol min typ max unit test conditions input res cin 30 pf capacitance nmi 30 pf all other input pins 20 pf current ordinary i cc 25 ma f = 12.5 mhz consumption operation 35 60 ma f = 20 mhz sleep 20 ma f = 12.5 mhz 30 40 ma f = 20 mhz standby 0.1 5 a ta 50 c 10 a50 c < ta analog power supply current ordinary operation, sleep ai cc 0.5 1 ma standby 0.1 5 a reference power supply current ordinary operation, sleep ai ref 0.5 1 ma standby 0.1 5 a ram standby voltage v ram 2.0 v vin = 0 v input signal f = 1 mhz ta = 25 c
520 usage notes: 1. if the a/d converter is not used, do not leave the av cc , v ref , and av ss pins open. connect av cc and av ref to v cc , and connect av ss to v ss . 2. current dissipation values are for v ih min = v cc - 0.5 v and v il max = 0.5 v with all output pins unloaded and the on-chip pull-up transistors in the off state. 3. when the a/d converter is not used, and in standby mode, av cc and av ref must still be connected to the power supply (v cc ). 4. the characteristic-related performance values, operating margins, noise margins, noise emissions, etc., of this lsi are different from hd6417034a, etc. caution is therefore required in carrying out system design, when switching from ztat version.
521 table 20.17 permitted output current values conditions: v cc = 3.3 v 20 to +75 40 to +85 12.5 mhz 20 mhz item symbol min typ max min typ max unit output low-level permissible current (per pin) i ol 10 10 ma output low-level permissible current (total) i ol 80 80 ma output high-level permissible current (per pin) i oh 2.0 2.0 ma output high-level permissible current (total) i oh 25 25 ma caution: to ensure reliability of the chip, do not exceed the output current values given in table 20.17.
522 20.2.3 ac characteristics the following ac timing chart represents the ac characteristics, not signal functions. for signal functions, see the explanation in the text. ( 1 ) clock timing table 20.18 clock timing conditions: v cc = 3.3 v 20 to +75 40 to +85 12.5 mhz 20 mhz item symbol min max min max unit figures extal input high level pulse width t exh 22 15 ns 20.45 extal input low level pulse width t exl 22 15 ns extal input rise time t exr 10 5ns extal input fall time t exf 10 5ns clock cycle time t cyc 80 500 50 250 ns 20.45, 20.46 clock high pulse width t ch 30 20 ns 20.46 clock low pulse width t cl 30 20 ns clock rise time t cr 10 5ns clock fall time t cf 10 5ns reset oscillation settling time t osc1 10 10 ms 20.47 software standby oscillation settling time t osc2 10 10 ms
523 t cyc t exh extal t exl t exf v ih v il t exr 1/2 v cc figure 20.45 extal input timing t cyc t ch t cr ck t cl t cf figure 20.46 system clock timing t osc2 t osc1 ck v cc res figure 20.47 oscillation settling time
524 ( 2 ) control signal timing table 20.19 control signal timing conditions: v cc = 3.3 v 20 to +75 40 to +85 12.5 mhz 20 mhz item symbol min max min max unit figure res setup time t ress 320 200 ns 20.48 res pulse width t resw 20 20 t cyc nmi reset setup time t nmirs 320 200 ns nmi reset hold time t nmirh 320 200 ns nmi setup time t nmis 160 100 ns 20.49 nmi hold time t nmih 80 50 ns irq0 irq7 setup time (edge detection) t irqes 160 100 ns irq0 irq7 setup time (level detection) t irqls 160 100 ns irq0 irq7 hold time t irqeh 80 50 ns irqout output delay time t irqod 80 50 ns 20.50 bus request setup time t brqs 80 50 ns 20.51 bus acknowledge delay time 1 t bacd1 80 50 ns bus acknowledge delay time 2 t bacd2 80 50 ns bus 3-state delay time t bzd 80 50 ns
525 ck res nmi t ress t ress t nmirs t resw t nmirh figure 20.48 reset input timing irq edge nmi t nmis ck t nmih t irqes t irqeh irq level t irqls figure 20.49 interrupt signal input timing irqout ck t irqod t irqod figure 20.50 interrupt signal output timing
526 t brqs t brqs t bacd1 t bzd t bzd t bacd2 ck breq (input) back (output) a21 a0 rd , wr , ras , cas , csn figure 20.51 bus release timing
527 ( 3 ) bus timing tables 20.20 show the bus timing. table 20.20 bus timing (1) conditions: v cc = 3.3 v 20 to +75 40 to +85 item symbol min max unit figures address delay time t ad 20 * 1 ns 20.52, 20.53, 20.55 20.58, 20.63, 20.64 cs delay time 1 t csd1 25 ns 20.52, 20.53, 20.64 cs delay time 2 t csd2 25 ns cs delay time 3 t csd3 25 ns 20.63 cs delay time 4 t csd4 25 ns access time 1 * 6 35% duty * 2 t rdac1 t cyc 0.65 20 ns 20.52 from read strobe 50% duty t cyc 0.5 20 ns access time 2 * 6 from read strobe 35% duty * 2 t rdac2 t cyc (n+1.65) 20 * 3 ns 20.53, 20.54 50% duty t cyc (n+1.5) 20 * 3 ns access time 3 * 6 from read strobe 35% duty * 2 t rdac3 t cyc (n+0.65) 20 * 3 ns 20.63 50% duty t cyc (n+0.5) 20 * 3 ns read strobe delay time t rsd 20 ns 20.52, 20.53, 20.55 20.59, 20.63 read data setup time t rds 15 ns 20.52, 20.53, 20.55 20.58, 20.63 read data hold time t rdh 0 ns write strobe delay time 1 t wsd1 20 ns 20.53, 20.57, 20.58, 20.63, 20.64 write strobe delay time 2 t wsd2 20 ns 20.53, 20.57, 20.58, 20.63 write strobe delay time 3 t wsd3 20 ns 20.55, 20.56 write strobe delay time 4 t wsd4 20 ns 20.55, 20.56, 20.64
528 table 20.20 bus timing (1) (cont) conditions: v cc = 3.3 v 20 to +75 40 to +85 item symbol min max unit figures write data delay time 1 t wdd1 35 ns 20.53, 20.57, 20.58, 20.63 write data delay time 2 t wdd2 20 ns 20.55, 20.56 write data hold time t wdh 0 ns 20.53, 20.55 20.58 parity output delay time 1 t wpdd1 40 ns 20.53, 20.57, 20.58 parity output delay time 2 t wpdd2 20 ns 20.55, 20.56 parity output hold time t wpdh 0 ns 20.53, 20.55 20.58 wait setup time t wts 10 ns 20.54, 20.59, 20.63 wait hold time t wth 6 ns read data access time 1 * 6 t acc1 t cyc 30 * 4 ns 20.52, 20.55, 20.56 read data access time 2 * 6 t acc2 t cyc (n+2) 30 * 3 ns 20.53, 20.54, 20.57 20.59 ras delay time 1 t rasd1 20 ns 20.55 20.58, ras delay time 2 t rasd2 30 ns 20.60 20.62 cas delay time 1 t casd1 20 ns 20.55 cas delay time 2 * 7 t casd2 20 ns 20.57, 20.58, cas delay time 3 * 7 t casd3 20 ns 20.60 20.62 column address setup time t asc 0 ns 20.55, 20.56 read data access time from cas 1 * 6 35% duty * 2 t cac1 t cyc 0.65 19 ns 50% duty t cyc 0.5 19 ns read data access time from cas 2 * 6 t cac2 t cyc (n+1) 25 * 3 ns 20.57 20.59 read data access time from ras 1 * 6 t rac1 t cyc 1.5 20 ns 20.55, 20.56 read data access time from ras 2 * 6 t rac2 t cyc (n+2.5) 20 * 3 ns 20.57 20.59 high-speed page mode cas precharge time t cp t cyc 0.25 ns 20.56
529 table 20.20 bus timing (1) (cont) conditions: v cc = 3.3 v 20 to +75 40 to +85 item symbol min max unit figures ah delay time 1 t ahd1 20 ns 20.63 ah delay time 2 t ahd2 20 ns multiplexed address delay time t mad 30 ns multiplexed address hold time t mah 0 ns dack0, dack1 delay time 1 t dacd1 23 ns 20.52, 20.53, 20.55 20.58, 20.63, 20.64 dack0, dack1 delay time 2 t dacd2 23 ns dack0, dack1 delay time 3 * 7 t dacd3 20 ns 20.53, 20.57, 20.58, 20.63 dack0, dack1 delay time 4 t dacd4 20 ns 20.55, 20.56 dack0, dack1 delay time 5 t dacd5 20 ns read delay time 35% duty * 2 t rdd t cyc 0.35 + 12 ns 20.52, 20.53, 20.55 50% duty t cyc 0.5 + 15 ns 20.59, 20.63 data setup time for cas t ds 0 * 5 ns 20.55, 20.57 cas setup time for ras t csr 10 ns 20.60 20.62 row address hold time t rah 10 ns 20.55, 20.57 write command hold time t wch 15 ns write command 35% duty * 2 t wcs 0 ns 20.55 setup time 50% duty t wcs 0 ns access time from cas precharge * 6 t acp t cyc ? 20 ns 20.56 notes: * 1 hbs and lbs signals are 25 ns. * 2 when frequency is 10 mhz or more. * 3 n is the number of wait cycles. * 4 access time from addresses a0 to a21 is tcyc-25 ns. * 5 5ns for parity output of dram long-pitch access. * 6 it is not necessary to meet the t rds specification as long as the access time specification is met. * 7 in the relationship of t casd2 and t casd3 with respect to t dacd3 , a min-max combination does not occur because of the logic structure.
530 table 20.20 bus timing (2) conditions: v cc = 3.3 v 20 to +75 40 to +85 item symbol min max unit figures address delay time t ad 40 ns 20.52, 20.53, 20.55 20.58, 20.63, 20.64 cs delay time 1 t csd1 40 ns 20.52, 20.53, 20.64 cs delay time 2 t csd2 40 ns cs delay time 3 t csd3 40 ns 20.63 cs delay time 4 t csd4 40 ns access time 1 * 4 35% duty * 1 t rdac1 t cyc 0.65 35 ns 20.52 from read strobe 50% duty t cyc 0.5 35 ns access time 2 * 4 from read strobe 35% duty * 1 t rdac2 t cyc (n+1.65) 35 * 2 ns 20.53, 20.54 50% duty t cyc (n+1.5) 35 * 2 ns access time 3 * 4 from read strobe 35% duty * 1 t rdac3 t cyc (n+0.65) 35 * 2 ns 20.63 50% duty t cyc (n+0.5) 35 * 2 ns read strobe delay time t rsd 40 ns 20.52, 20.53, 20.55 20.59, 20.63 read data setup time t rds 25 ns 20.52, 20.53, 20.55 20.58, 20.63 read data hold time t rdh 0 ns write strobe delay time 1 t wsd1 40 ns 20.53, 20.57, 20.58, 20.63, 20.64 write strobe delay time 2 t wsd2 30 ns 20.53, 20.57, 20.58, 20.63 write strobe delay time 3 t wsd3 40 ns 20.55, 20.56 write strobe delay time 4 t wsd4 40 ns 20.55, 20.56, 20.64
531 table 20.20 bus timing (2) (cont) conditions: v cc = 3.3 v 20 to +75 40 to +85 item symbol min max unit figures write data delay time 1 t wdd1 70 ns 20.53, 20.57, 20.58, 20.63 write data delay time 2 t wdd2 40 ns 20.55, 20.56 write data hold time t wdh 10 ns 20.53, 20.55 20.58, 20.63 parity output delay time 1 t wpdd1 80 ns 20.53, 20.57, 20.58 parity output delay time 2 t wpdd2 40 ns 20.55, 20.56 parity output hold time t wpdh 10 ns 20.53, 20.55 20.58 wait setup time t wts 40 ns 20.54, 20.59, 20.63 wait hold time t wth 10 ns read data access time 1 * 4 t acc1 t cyc 44 ns 20.52, 20.55, 20.56 read data access time 2 * 4 t acc2 t cyc (n+2) 44 * 2 ns 20.53, 20.54, 20.57 20.59 ras delay time 1 t rasd1 40 ns 20.55 20.58, ras delay time 2 t rasd2 40 ns 20.60 20.62 cas delay time 1 t casd1 40 ns 20.55 cas delay time 2 * 5 t casd2 40 ns 20.57, 20.58, cas delay time 3 * 5 t casd3 40 ns 20.60 20.62 column address setup time t asc 0 ns 20.55, 20.56 read data access time from cas 1 * 4 35% duty * 1 t cac1 t cyc 0.65 35 ns 50% duty t cyc 0.5 35 ns read data access time from cas 2 * 4 t cac2 t cyc (n+1) 35 * 2 ns 20.57 20.59 read data access time from ras 1 * 4 t rac1 t cyc 1.5 35 ns 20.55, 20.56 read data access time from ras 2 * 4 t rac2 t cyc (n+2.5) 35 * 2 ns 20.57 20.59 high-speed page mode cas precharge time t cp t cyc 0.25 ns 20.56
532 table 20.20 bus timing (2) (cont) conditions: v cc = 3.3 v 20 to +75 40 to +85 item symbol min max unit figures ah delay time 1 t ahd1 40 ns 20.63 ah delay time 2 t ahd2 40 ns multiplexed address delay time t mad 40 ns multiplexed address hold time t mah 10 ns dack0, dack1 delay time 1 t dacd1 40 ns 20.52, 20.53, 20.55 20.58, 20.63, 20.64 dack0, dack1 delay time 2 t dacd2 40 ns dack0, dack1 delay time 3 * 5 t dacd3 40 ns 20.53, 20.57, 20.58, 20.63 dack0, dack1 delay time 4 t dacd4 40 ns 20.55, 20.56 dack0, dack1 delay time 5 t dacd5 40 ns read delay time 35% duty * 1 t rdd t cyc 0.35 + 35 ns 20.52, 20.53, 20.55 50% duty t cyc 0.5 + 35 ns 20.59, 20.63 data setup time for cas t ds 0 * 3 ns 20.55, 20.57 cas setup time for ras t csr 10 ns 20.60 20.62 row address hold time t rah 10 ns 20.55, 20.57 write command hold time t wch 15 ns write command 35% duty * 1 t wcs 0 ns 20.55 setup time 50% duty 0 ns access time from cas precharge * 4 t acp t cyc ? 20 ns 20.56 notes: * 1 when frequency is 10 mhz or more. * 2 n is the number of wait cycles. * 3 5ns for parity output of dram long-pitch access. * 4 if the access time is satisfied, t rds need not be satisfied. * 5 in the relationship between t casd2 and t casd3 for t dacd3 , the pair of min-max is not exist in the logical structure.
533 ck a21 a0 hbs , lbs csn dack0 rd (read) dack1 ad15 ad0 dph, dpl (read) t 1 t ad t csd1 t csd2 t rsd t rdac1 * 1 t acc1 * 2 t rds t rdh * 3 t dacd1 t dacd2 t rdd notes: * 1 for t rdac1 , use t cyc 0.65 20 (for 35% duty) or t cyc 0.5 20 (for 50% duty) instead of t cyc t rdd t rds . * 2 for t acc1 , use t cyc 30 instead of t cyc t ad (or t csd1 ) t rds . * 3t rdh is measured from a21 a0, csn , or rd , whichever is negated first. figure 20.52 basic bus cycle: one-state access
534 t 1 t 2 t ad t rdd t csd2 t rsd t rdac2 * 1 t acc2 * 2 t rds t rdh * 3 t dacd2 t dacd1 t wsd2 t wsd1 t dacd3 t dacd3 t wdh t wdd1 t wpdh t wpdd1 ck a21 a0 hbs , lbs csn dack0 dack1 (read) rd (read) wrh , wrl , wr (write) ad15 ad0 dph, dpl (read) ad15 ad0 (write) dph, dpl (write) dack0 dack1 (write) t csd1 notes: * 1 for t rdac2 , use t cyc (n + 1.65) 20 (for 35% duty) or t cyc (n + 1.5) 20 (for 50% duty) instead of t cyc (n + 2) t rdd t rds . * 2 for t acc2 , use t cyc (n + 2) 30 instead of t cyc (n + 2) t ad (or t csd1 ) t rdh . * 3t rdh is measured from a21 a0, csn , or rd , whichever is negated first. figure 20.53 basic bus cycle: two-state access
535 dack0 dack1 (read) rd (read) csn ad15 ad0 dph, dpl (read) a21 a0 hbs , lbs dack0 dack1 (write) ck wait ad15 ad0 dph, dpl (write) wrh , wrl , wr (write) t 1 t w t 2 t wts t wth t wts t wth t rdac2 * 1 t acc2 * 2 notes: * 1 for t rdac2 , use t cyc (n+1.65) 20 (for 35% duty) or t cyc (n+1.5) 20 (for 50% duty) instead of t cyc (n+2) t rdd t rds . * 2 for t acc2 , use t cyc (n+2) 30 instead of t cyc (n+2) t ad (or t csd1 ) t rds . figure 20.54 basic bus cycle: two states + wait state
536 ck a21 a0 ras cas wrh , wrl , wr (read) dack0 dack1 (read) ad15 ad0 dph, dpl (read) wrh , wrl , wr (write) ad15 ad0 (write) dph, dpl (write) dack0 dack1 (write) t p t r t c t ad t ad t rasd1 t rasd2 t casd1 t dacd1 t cac1 * 1 t rds t rdh * 4 t wsd3 t wdd2 t wdh t wpdd2 t wpdh t dacd4 t dacd5 t acc1 * 2 t rah t dacd2 t wsd4 t wch t asc t ds row column t wcs t rac1 * 3 rd (write) rd (read) t rsd t rdd notes: * 1 for t cac1 , use t cyc 0.65 19 (for 35% duty) or t cyc 0.5 19 (for 50% duty) instead of t cyc t ad t asc t rds . * 2 for t acc1 , use t cyc 30 instead of t cyc t ad t rds . * 3 for t rac1 , use t cyc 1.5 20 instead of t cyc 1.5 t rasd1 t rds . * 4t rdh is measured from a21 a0, ras , or cas , whichever is negated first. figure 20.55 dram bus cycle (short-pitch, normal mode)
537 ck a21 a0 ras cas wrh , wrl , wr (read) dack0 dack1 (read) ad15 ad0 dph, dpl (read) t ad t p t r t c t c t c t ad t rasd1 t rasd2 t cp t asc t rdh * 5 t rac1 * 3 t dacd1 t dacd2 column address column address column address t cac1 * 1 t c t acc1 * 2 t rds rd (read) t rdd t acp t rsd t rdh * 4 row address column address notes: * 1 for t cac1 , use t cyc 0.65 19 (for 35% duty) or t cyc x 0.5 19 (for 50% duty) instead of t cyc t ad t asc t rds . it is not necessary to meet the t rds specification as long as the t cac1 specification is met. * 2 for t acc1 , use t cyc 30 instead of t cyc t ad t rds . it is not necessary to meet the t rds specification as long as the t acc1 specification is met. * 3 for t rac1 , use t cyc 1.5 20 instead of t cyc 1.5 t rasd1 t rds . it is not necessary to meet the t rds specification as long as the t rac1 specification is met. * 4t rdh is measured from a21 a0 or cas , whichever is negated first. * 5t rdh is measured from a21 a0, ras , or cas , whichever is negated first. figure 20.56 (a) dram bus cycle (short-pitch, high-speed page mode: read)
538 ck a21 a0 ras cas wrh , wrl , wr (write) dack0 dack1 (write) ad15 ad0 dph, dpl (write) dph, dpl (write) t ad t p t r t c silent cycle t c t ad t rasd1 t rasd2 t asc t dacd4 t dacd5 t dacd5 rd (write) t wsd4 t wsd3 t wdd2 t wdh t wpdd2 t wpdh column address column address row address figure 20.56 (b) dram bus cycle (short-pitch, high-speed page mode: write) note: for details of the silent cycle, see section 8.5.5, dram burst mode.
539 ck a21 a0 ras cas wrh , wrl , wr (read) dack0 dack1 (read) ad15 ad0 dph, dpl (read) wrh , wrl , wr (write) ad15 ad0 (write) t ad t p t r t c1 t c2 t ad t rasd1 t rasd2 dack0 dack1 (write) dph, dpl (write) column t casd3 t acc2 * 2 t rdh * 4 t dacd1 t dacd2 t wsd1 t wsd2 t wdd1 t wdh t wpdh t wpdd1 t dacd3 t dacd3 t rac2 * 3 t ds t casd2 t wch t cac2 * 1 rd (write) rd (read) t rdd t rsd row t rah t rds notes: * 1 for t cac2 , use t cyc (n + 1) 25 instead of t cyc (n + 1) t casd2 t rds . * 2 for t acc2 , use t cyc (n + 2) 30 instead of t cyc (n + 2) t ad t rds . * 3 for t rac2 , use t cyc (n + 2.5) 20 instead of t cyc (n + 2.5) t rasd1 t rds . * 4t rdh is measured from a21 a0, cas , or ras , whichever is negated first. figure 20.57 dram bus cycle: (long-pitch, normal mode)
540 ck a21 a0 ras cas wrh , wrl , wr (read) dack0 dack1 (read) ad15 ad0 dph, dpl (read) wrh , wrl , wr (write) ad15 ad0 (write) dack0 dack1 (write) dph, dpl (write) t p t r t c1 t c2 t c1 t c2 t ad t ad t rasd1 t rasd2 t casd3 t casd2 t rdh * 5 t casd3 t rdh * 4 t rac2 * 3 t acc2 * 2 t cac2 * 1 t rds t dacd1 t dacd1 t dacd2 t dacd2 t wsd1 t wsd1 t wsd2 t wsd2 t wdd1 t wdh t wdd1 t wdh t wpdd1 t wpdd1 t wpdh t wpdh t dacd3 t dacd3 t dacd3 t dacd3 column column rd (write) rd (read) t rdd t rsd row notes: * 1 for t cac2 , use t cyc (n + 1) 25 instead of t cyc (n + 1) t casd2 t rds . * 2 for t acc2 , use t cyc (n + 2) 30 instead of t cyc (n + 2) t ad t rds . * 3 for t rac2 , use t cyc (n + 2.5) 20 instead of t cyc (n + 2.5) t rasd2 t rds . * 4t rdh is measured from a21 a0 or cas , whichever is negated first. * 5t rdh is measured from a21 a0, ras , or cas whichever is negated first. figure 20.58 dram bus cycle: (long-pitch, high-speed page mode)
541 ck a21 a0 ras cas wrh , wrl , wr (read) dack0 dack1 (read) ad15 ad0 dph, dpl (read) wrh , wrl , wr (write) ad15 ad0 (write) dack0 dack1 (write) dph, dpl (write) wait t p t r t c1 t w t c2 row column t wts t wth t wts t wth t acc2 * 2 t rac2 * 3 t cac2 * 1 rd (write) rd (read) t rsd t rdd notes: * 1 for t cac2 , use t cyc (n + 1) 25 instead of t cyc (n + 1) t casd2 t rds . * 2 for t acc2 , use t cyc (n + 2) 30 instead of t cyc (n + 2) t ad t rds . * 3 for t rac2 , use t cyc (n + 2.5) 20 instead of t cyc (n + 2.5) t rasd1 t rds . figure 20.59 dram bus cycle: (long-pitch, high-speed page mode + wait state)
542 ck ras cas wrh , wrl , wr t rp t rr t rc t rasd1 t rasd2 t casd3 t casd2 t csr figure 20.60 cas-before-ras refresh (short-pitch) ck ras cas wrh , wrl , wr t rp t rc t rc t rasd1 t rasd2 t casd3 t casd2 t rr t csr figure 20.61 cas-before-ras refresh (long-pitch)
543 ck ras cas t rp t rc t rcc t rasd1 t rasd2 t casd3 t casd2 t rr t csr figure 20.62 self-refresh
544 ck a21 a0 hbs , lbs cs6 ah rd (read) dack0 dack1 (read) ad15 ad0 (read) wrh , wrl , wr (write) ad15 ad0 (write) dack0 dack1 (write) wait t 1 t 2 t 3 t 4 t csd4 t csd3 t ad t ahd1 t ahd2 t rsd t rdh t mah t mad t rdac3 t dacd2 t dacd1 t wsd1 t wsd2 t mad t mah t wdd1 t dacd3 t dacd3 t wth t wts address address data (output) t rdd t wdh data (input) figure 20.63 address/data multiplex i/o bus cycle
545 ck a21 a0 hbs , lbs csn dack0 dack1 (write) wrh , wrl , wr (write) t 1 t ad t csd1 t csd2 t wsd4 t dacd1 t dacd2 t wsd1 figure 20.64 dma single transfer/one-state access write
546 ( 4 ) dmac timing table 20.21 dmac timing conditions: v cc = 3.3 v 20 to +75 40 to +85 12.5 mhz 20 mhz item symbol min max min max unit figure dreq0 , dreq1 setup time t drqs 80 27 ns 20.65 dreq0 , dreq1 hold time t drqh 30 30 ns dreq0 , dreq1 pulse width t drqw 1.5 1.5 t cyc 20.66 t drqs t drqs ck dreq0 , dreq1 level dreq0 , dreq1 edge t drqs t drqh dreq0 , dreq1 level release figure 20.65 dreq0 , dreq1 input timing (1)
547 ck t drqw dreq0 , dreq1 edge figure 20.66 dreq0 , dreq1 input timing (2) ( 5 ) 16-bit integrated timer pulse unit timing table 20.22 16-bit integrated timer pulse unit timing conditions: v cc = 3.3 v 20 to +75 40 to +85 12.5 mhz 20 mhz item symbol min max min max unit figure output compare delay time t tocd 100 100 ns 20.67 input capture setup time t tics 50 35 ns timer clock input setup time t tcks 50 50 ns 20.68 timer clock pulse width (single edge) t tckwh/l 1.5 1.5 t cyc timer clock pulse width (both edges) t tckwl/l 2.5 2.5 t cyc t tocd ck t tics output compare * 1 input capture * 2 notes: * 1 tioca0 tioca4, tiocb0 tiocb4, tocxa4, tocxb4 * 2 tioca0 tioca4, tiocb0 tiocb4 figure 20.67 itu input/output timing
548 t tcks ck t tckwh t tckwl t tcks tclka tclkd figure 20.68 itu clock input timing ( 6 ) programmable timing pattern controller and i/o port timing table 20.23 programmable timing pattern controller and i/o port timing conditions: v cc = 3.3 v 20 to +75 40 to +85 item symbol min max unit figure port output delay time t pwd 100 ns 20.69 port input hold time t prh 50 ns port input setup time t prs 50 ns t prs ck t pwd ports a c (read) ports a c (write) t 1 t 2 t 3 t prh figure 20.69 programmable timing pattern controller output timing
549 ( 7 ) watchdog timer timing table 20.24 watchdog timer timing conditions: v cc = 3.3 v 20 to +75 40 to +85 item symbol min max unit figure wdtovf delay time t wovd 100 ns 20.70 t wovd ck t wovd wdtovf figure 20.70 watchdog timer output timing
550 ( 8 ) serial communication interface timing table 20.25 serial communication interface timing conditions: v cc = 3.3 v 20 to +75 40 to +85 item symbol min max unit figure input clock cycle t scyc 4 t cyc 20.71 input clock cycle (synchronous mode) t scyc 6 t cyc input clock pulse width t sckw 0.4 0.6 t scyc input clock rise time t sckr 1.5 t cyc input clock fall time t sckf 1.5 t cyc transmit data delay time (synchronous mode) t txd 100 ns 20.72 receive data setup time (synchronous mode) t rxs 100 ns receive data hold time (synchronous mode) t rxh 100 ns sck0, sck1 t scyc t sckw t sckr t sckf figure 20.71 input clock timing
551 sck0, sck1 t scyc t rxs t txd t rxh txd0, txd1 (transmit data) rxd0, rxd1 (receive data) figure 20.72 sci i/o timing (synchronous mode) ( 9 ) a/d converter timing table 20.26 a/d converter timing conditions: v cc = 3.3 v 20 to +75 40 to +85 item symbol min typ max unit figure external trigger input pulse width t trgw 2.0 t cyc 20.73 external trigger input start delay time t trgs 50 ns a/d conversion start delay time cks = 0 t d 10 17 t cyc 20.74 cks = 1 6 9t cyc input sampling time cks = 0 t spl 64 t cyc cks = 1 32 t cyc a/d conversion time cks = 0 t conv 259 266 t cyc cks = 1 131 134 t cyc
552 ck 1 state t trgs t trgw t trgw adtrg input adst figure 20.73 external trigger input timing t spl max. 14 states t d 3 states t conv ck address analog input sampling signal adf figure 20.74 analog conversion timing
553 ( 10 ) ac characteristics test conditions v v ref i oh c l device under test output microcomputer output pin i ol c l is set as follows for each pin. 30pf: ck, cash , casl , cs0 cs7 , breq , back , ah , irqout , ras , dack0, dack1 50pf: a21 a0, ad15 ad0, dph, dpl, rd , wrh , wrl , hbs , lbs , wr 70pf: all port outputs and supporting module output pins other than the above. i ol and i oh values are as shown in section 20.2.2, dc characteristics, and table 20.18, permitted output current values. figure 20.75 output load circuit
554 20.2.4 a/d converter characteristics table 20.27 a/d converter characteristics conditions: v cc = 3.3 v 20 to +75 40 to +85 12.5 mhz 20 mhz item min typ max min typ max unit resolution 10 10 10 10 10 10 bit conversion time 11.2 6.7 s analog input capacitance 20 20 pf permissible signal-source impedance 1 1k ? nonlinearity error * 4.0 4.0 lsb offset error * 4.0 4.0 lsb full-scale error * 4.0 4.0 lsb quantization error * 0.5 0.5 lsb absolute accuracy 6.0 6.0 lsb note: * reference value
555 appendix a on-chip supporting module registers a.1 list of registers the addresses and bit names of the on-chip supporting module registers are listed below. 16- and 32-bit registers are shown as two or four levels of 8 bits each.
556 table a.1 8-bit access space (8-bit and 16-bit accessible, 32-bit access disabled) bit name address register 7 6 5 43210 module h'5fffe00 h'5fffebf h'5fffec0 smr0 c/ a chr pe o/ e stop mp cks1 cks0 sci h'5fffec1 brr0 (channel 0) h'5fffec2 scr0 tie rie te re mpie teie cke1 cke0 h'5fffec3 tdr0 h'5fffec4 ssr0 tdre rdrf orer fer per tend mpb mpbt h'5fffec5 rdr0 h'5fffec6 h'5fffec7 h'5fffec8 smr1 c/ a chr pe o/ e stop mp cks1 cks0 sci h'5fffec9 brr1 (channel 1) h'5fffeca scr1 tie rie te re mpie teie cke1 cke0 h'5fffecb tdr1 h'5fffecc ssr1 tdre rdrf orer fer per tend mpb mpbt h'5fffecd rdr1 h'5fffece h'5fffedf h'5fffee0 addrah ad9 ad8 ad7 ad6 ad5 ad4 ad3 ad2 a/d h'5fffee1 addral ad1 ad0 h'5fffee2 addrbh ad9 ad8 ad7 ad6 ad5 ad4 ad3 ad2 h'5fffee3 addrbl ad1 ad0 h'5fffee4 addrch ad9 ad8 ad7 ad6 ad5 ad4 ad3 ad2 h'5fffee5 addrcl ad1 ad0 h'5fffee6 addrdh ad9 ad8 ad7 ad6 ad5 ad4 ad3 ad2 h'5fffee7 addrdl ad1 ad0 h'5fffee8 adcsr adf adie adst scan cks ch2 ch1 ch0 h'5fffee9 adcr trge h'5fffeea h'5fffeef
557 table a.2 16-bit access space (in principle, 8-bit, 16-bit and 32-bit accessible) bit name address register 7 6 5 43210 module h'5ffff00 tstr * 1 str4 str3 str2 str1 str0 h'5ffff01 tsnc * 1 sync4 sync3 sync2 sync1 sync0 h'5ffff02 tmdr * 1 mdf fdir pwm4 pwm3 pwm2 pwm1 pwm0 h'5ffff03 tfcr * 1 cmd1 cmd0 bfb4 bfa4 bfb3 bfa3 h'5ffff04 tcr0 * 1 cclr1 cclr0 ckeg1 ckeg0 tpsc2 tpsc1 tpsc0 h'5ffff05 tior0 * 1 iob2 iob1 iob0 ioa2 ioa1 ioa0 h'5ffff06 tier0 * 1 ovie imieb imiea h'5ffff07 tsr0 * 1 ovf imfb imfa h'5ffff08 tcnt0 h'5ffff09 h'5ffff0a gra0 h'5ffff0b h'5ffff0c grb0 h'5ffff0d h'5ffff0e tcr1 * 1 cclr1 cclr0 ckeg1 ckeg0 tpsc2 tpsc1 tpsc0 h'5ffff0f tiorl * 1 iob2 iob1 iob0 ioa2 ioa1 ioa0 h'5ffff10 tierl * 1 ovie imieb imiea h'5ffff11 tsr1 * 1 ovf imfb imfa h'5ffff12 tcnt1 h'5ffff13 h'5ffff14 gra1 h'5ffff15 h'sffff16 grb1 h'5ffff17 h'5ffff18 tcr2 * 1 cclr1 cclr0 ckeg1 ckeg0 tpsc2 tpsc1 tpsc0 h'5ffff19 tior2 * 1 iob2 iob1 iob0 ioa2 ioa1 ioa0 h'5ffff1a tier2 * 1 ovie imieb imiea h'5ffff1b tsr2 * 1 ovf imfb imfa h'5ffff1c tcnt2 h'5ffff1d h'5ffff1e gra2 h'5ffff1f h'5ffff20 grb2 h'5ffff21 itu (chan- nels 0? shared) itu (chan- nel 0) itu (chan- nel 1) itu (chan- nel 2)
558 table a.2 16-bit access space (in principle, 8-bit, 16-bit and 32-bit accessible) (cont) bit name address register 7 6 5 43210 module h'5ffff22 tcr3 * 1 cclr1 cclr0 ckeg1 ckeg0 tpsc2 tpsc1 tpsc0 itu (chan- h'5ffff23 tior3 * 1 iob2 iob1 iob0 ioa2 ioa1 ioa0 nel 3) h'5ffff24 tier3 * 1 ovie imieb imiea h'5ffff25 tsr3 * 1 ovf imfb imfa h'5ffff26 tcnt3 h'5ffff27 h'5ffff28 gra3 h'5ffff29 h'5ffff2a grb3 h'5ffff2b h'5ffff2c bra3 h'5ffff2d h'5ffff2e brb3 h'5ffff2f h'5ffff31 tocr * 1 ols4 ols3 itu (chan- nels 0? shared) h'5ffff32 tcr4 * 1 cclr1 cclr0 ckeg1 ckeg0 tpsc2 tpsc1 tpsc0 itu (chan- h'5ffff33 tior4 * 1 iob2 iob1 iob0 ioa2 ioa1 ioa0 nel 4) h'5ffff34 tier4 * 1 ovie imieb imiea h'5ffff35 tsr4 * 1 ovf imfb imfa h'5ffff36 tcnt4 h'5ffff37 h'5ffff38 gra4 h'5ffff39 h'5ffff3a grb4 h'5ffff3b h'5ffff3c bra4 h'5ffff3d h'5ffff3e brb4 h'5ffff3f
559 table a.2 16-bit access space (in principle, 8-bit, 16-bit and 32-bit accessible) (cont) bit name address register 76543210 module h'5ffff40 sar0 * 5 dmac h'5ffff41 channel 0 h'5ffff42 h'5ffff43 h'5ffff44 dar0 * 5 h'5ffff45 h'5ffff46 h'5ffff47 h'5ffff48 dmaor * 2 pr1pr0 h'5ffff49 ?e nmif dme h'5ffff4a tcr0 * 5 h'5ffff4b h'5ffff4c h'5ffff4d h'5ffff4e chcr0 dm1 dm0 sm1 sm0 rs3 rs2 rs1 rs0 h'5ffff4f am al ds tm ts ie te de h'5ffff50 sar1 * 5 dmac h'5ffff51 channel 1 h'5ffff52 h'5ffff53 h'5ffff54 dar1 * 5 h'5ffff55 h'5ffff56 h'5ffff57 h'5ffff58 h'5ffff59 h'5ffff5a tcr1 * 5 h'5ffff5b h'5ffff5c h'5ffff5d h'5ffff5e chcr1 dm1 dm0 sm1 sm0 rs3 rs2 rs1 rs0 h'5ffff5f am al ds tm ts ie te de
560 table a.2 16-bit access space (in principle, 8-bit, 16-bit and 32-bit accessible) (cont) bit name address register 76543210 module h'5ffff60 sar2 * 5 dmac h'5ffff61 channel 2 h'5ffff62 h'5ffff63 h'5ffff64 dar2 * 5 h'5ffff65 h'5ffff66 h'5ffff67 h'5ffff68 h'5ffff69 h'5ffff6a tcr2 * 5 h'5ffff6b h'5ffff6c h'5ffff6d h'5ffff6e chcr2 dm1 dm0 sm1 sm0 rs3 rs2 rs1 rs0 h'5ffff6f am al ds tm ts ie te de h'5ffff70 sar3 * 5 dmac h'5ffff71 channel 3 h'5ffff72 h'5ffff73 h'5ffff74 dar3 * 5 h'5ffff75 h'5ffff76 h'5ffff77 h'5ffff78 h'5ffff79 h'5ffff7a tcr3 * 5 h'5ffff7b h'5ffff7c h'5ffff7d h'5ffff7e chcr3 dm1 dm0 sm1 sm0 rs3 rs2 rs1 rs0 h5ffff7f am al ds tm ts ie te de
561 table a.2 16-bit access space (in principle, 8-bit, 16-bit and 32-bit accessible) (cont) bit name address register 76543210 module h'5ffff80 h'5ffff83 intc h'5ffff84 ipra h'5ffff85 h'5ffff86 iprb h'5ffff87 h'5ffff88 iprc h'5ffff89 h'5ffff8a iprd h'5ffff8b h'5ffff8c ipre h'5ffff8d h'5ffff8e icr nmil nmie h'5ffff8f irq0s irq1s irq2s irq3s irq4s irq5s irq6s irq7s h'5ffff90 barh ba31 ba30 ba29 ba28 ba27 ba26 ba25 ba24 ubc h'5ffff91 ba23 ba22 ba21 ba20 ba19 ba18 ba17 ba16 h'5ffff92 barl ba15 ba14 ba13 ba12 ba11 ba10 ba9 ba8 h'5ffff93 ba7 ba6 ba5 ba4 ba3 ba2 ba1 ba0 h'5ffff94 bamrh bam31 bam30 bam29 bam28 bam27 bam26 bam25 bam24 h'5ffff95 bam23 bam22 bam21 bam20 bam19 bam18 bam17 bam16 h'5ffff96 bamrl bam15 bam14 bam13 bam12 bam11 bam10 bam9 bam8 h'5ffff97 bam7 bam6 bam5 bam4 bam3 bam2 bam1 bam0 h'5ffff98 bbr h'5ffff99 cd1 cd0 id1 id0 rw1 rw0 sz1 sz0 h'5ffff9a h'5ffff9f
562 table a.2 16-bit access space (in principle, 8-bit, 16-bit and 32-bit accessible) (cont) bit name address register 7 6 5 4 3 2 1 0 module h'5ffffa0 bcr drame ioe warp rddty bas bsc h'5ffffa1 h'5ffffa2 wcr1 rw7 rw6 rw5 rw4 rw3 rw2 rw1 rw0 h'5ffffa3 ww1 h'5ffffa4 wcr2 drw7 drw6 drw5 drw4 drw3 drw2 drw1 drw0 h'5ffffa5 dww7 dww6 dww5 dww4 dww3 dww2 dww1 dww0 h'5ffffa6 wcr3 wpu a02lw1 a02lw0 a6lw1 a6lw0 h'5ffffa7 h'5ffffa8 dcr cw2 rasd tpc be cdty mxe mxc1 mxc0 h'5ffffa9 h'5ffffaa pcr pef pfrc peo pchk1 pchk0 h'5ffffab h'5ffffac rcr h'5ffffad rfshe rmode rlw1 rlw0 h'5ffffae rtcsr h'5ffffaf cmf cmie cks2 cks1 cks0 h'5ffffb0 rtcnt h'5ffffb1 h'5ffffb2 rtcor h'5ffffb3 h'5ffffb4 h'5ffffb7 h'5ffffb8 tcsr * 3 ovf wt/ lt tme cks2 cks1 cks0 wdt h'5ffffb9 tcnt * 3 h'5ffffba h'5ffffbb rstcsr * 3 wovf rste rsts h'5ffffbc sbycr sby hiz power down state h'5ffffbd h'5ffffbf
563 table a.2 16-bit access space (in principle, 8-bit, 16-bit and 32-bit accessible) (cont) bit name address register 7 6 5 4 3 2 1 0 module h'5ffffc0 padr pa15 dr pa14 dr pa13 dr pa12 dr pa11 dr pa10 dr pa9 dr pa8 dr port a h'5ffffc1 pa7 dr pa6 dr pa5 dr pa4 dr pa3 dr pa2 dr pa1 dr pa0 dr h'5ffffc2 pbdr pb15 dr pb14 dr pb13 dr pb12 dr pb11 dr pb10 dr pb9 dr pb8 dr port b h'5ffffc3 pb7 dr pb6 dr pb5 dr pb4 dr pb3 dr pb2 dr pb1 dr pb0 dr h'5ffffc4 paior pa15 ior pa14 ior pa13 ior pa12 ior pa11 ior pa10 ior pa9 ior pa8 ior pfc h'5ffffc5 pa7 ior pa6 ior pa5 ior pa4 ior pa3 ior pa2 ior pa1 ior pa0 ior h'5ffffc6 pbior pb15 ior pb14 ior pb13 ior pb12 ior pb11 ior pb10 ior pb9 ior pb8 ior h'sffffc7 pb7 ior pb6 ior pb5 ior pb4 ior pb3 ior pb2 ior pb1 ior pb0 ior h'5ffffc8 pacr1 pa15 md1 pa15 md0 pa14 md1 pa14 md0 pa13 md1 pa13 md0 pa12 md1 pa12 md0 h'5ffffc9 pa11 md1 pa11 md0 pa10 md1 pa10 md0 pa9 md1 pa9 md0 pa8 md h'5ffffca pacr2 pa7 md pa6 md pa5 md pa4 md h'5ffffcb pa3 md1 pa3 md0 pa2 md1 pa2 md0 pa1 md1 pa1 md0 pa0 md1 pa0 md0 h'5ffffcc pbcr1 pb15 md1 pb15 md0 pb14 md1 pb14 md0 pb13 md1 pb13 md0 pb12 md1 pb12 md0 h'5ffffcd pb11 md1 pb11 md0 pb10 md1 pb10 md0 pb9 md1 pb9 md0 pb8 md1 pb8 md0 h'5ffffce pbcr2 pb7 md1 pb7 md0 pb6 md1 pb6 md0 pb5 md1 pb5 md0 pb4 md1 pb4 md0 h'5ffffcf pb3 md1 pb3 md0 pb2 md1 pb2 md0 pb1 md1 pb1 md0 pb0 md1 pb0 md0 h'5ffffd0 pcdr port c h'5ffffd1 pc7 dr pc6 dr pc5 dr pc4 dr pc3 dr pc2 dr pc1 dr pc0 dr
564 table a.2 16-bit access space (in principle, 8-bit, 16-bit and 32-bit accessible) (cont) bit name address register 7 6 5 4 3 2 1 0 module h'5ffffd2 h'5ffffed pfc h'5ffffee cascr cash md1 cash md0 casl md1 casl md0 h'5ffffef tpc h'5fffff0 tpmr g3n ov g2n ov g1n ov g0n ov h'5fffff1 tpcr g3c ms1 g3c ms0 g2c ms1 g2c ms0 g1c ms1 g1c ms0 g0c ms1 g0c ms0 h'5fffff2 nderb nde r15 nde r14 nde r13 nde r12 nde r11 nde r10 nde r9 nde r8 h'5fffff3 ndera nde r7 nde r6 nde r5 nde r4 nde r3 nde r2 nde r1 nde r0 h'5fffff4 ndrb * 4 ndr15 ndr14 ndr13 ndr12 h'5fffff5 ndra * 4 ndr7 ndr6 ndr5 ndr4 h'5fffff6 ndrb * 4 ndr11 ndr10ndr9 ndr8 h'5fffff7 ndra * 4 ndr3 ndr2 ndr1 ndr0 h'5fffff8 h'5ffffff notes * 1 only 8-bit accessible. 16-bit and 32-bit access disabled. * 2 register shared by all channels. * 3 address for read. for writing, the addresses are h'5ffffb8 for tcr and tcnt and h'5ffffba for rstcsr. for more information, see section 12, watchdog timer (wdt), particularly section 12.2.4, notes on register access. * 4 when the output triggers for tpc output group 0 and tpc output group 1 set by tpcr are the same, the ndra address is h'5fffff5; when the output triggers are different, the ndra address for group 0 is h'5fffff7 and the ndra address for group 1 is h'5fffff5. likewise, when the output triggers for tpc output group 2 and tpc output group 3 set by tpcr are the same, the ndrb address is h'5fffff4; when the output triggers are different, the ndrb address for group 2 is h'5fffff6 and the ndrb address for group 3 is h'5fffff4. * 5 16-bit and 32-bit accessible. 8-bit access disabled.
565 a.2 register tables a.2.1 serial mode register (smr) sci ? start address: h'5fffec0 (channel 0), h'5fffec8 (channel 1) ? bus width: 8/16 register overview: bit: 7 6 5 4 3 2 1 0 bit name: c/ a chr pe o/ e stop mp cks1 cks0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w table a.3 smr bit functions bit bit name value * description 7 communication mode (c/ a ) 0 asynchronous mode (initial value) 1 synchronous mode 6 character length (chr) 0 8-bit data (initial value) 1 7-bit data 5 parity enable (pe) 0 parity bit addition and check disable (initial value) 1 parity bit addition and check enable 4 parity mode (o/ e ) 0 even parity (initial value) 1 odd parity 3 stop bit length (stop) 0 1 stop bit (initial value) 1 2 stop bits 2 multiprocessor mode (mp) 0 multiprocessor function disabled (initial value) 1 multiprocessor function selected 1,0 clock select 1, 0 (cks1, cks0) 0 0 clock (initial value) 01 /4 clock 10 /16 clock 11 /64 clock note: * when 2 or more bits are treated as a group, the left side is the upper bit and the right the lower bit.
566 a.2.2 bit rate register (brr) sci ? start address: h'5fffec1 (channel 0), h'5fffec9 (channel 1) ? bus width: 8/16 register overview: bit: 7 6 5 4 3 2 1 0 bit name: initial value: 1 1 1 1 1 1 1 1 r/w: r/w r/w r/w r/w r/w r/w r/w r/w table a.4 bbr bit functions bit bit name description 7? (bit rate setting) set serial transmission/reception bit rate a.2.3 serial control register (scr) sci ? start address: h'5fffec2 (channel 0), h'5fffeca (channel 1) ? bus width: 8/16 register overview: bit: 7 6 5 4 3 2 1 0 bit name: tie rie te re mpie teie cke1 cke0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w
567 table a.5 scr bit functions bit bit name value description 7 transmit interrupt enable (tie) 0 transmit data-empty interrupt request (txi) disabled (initial value) 1 transmit data-empty interrupt request (txi) enabled 6 receive interrupt enable (rie) 0 receive-data-full interrupt request (rxi) and receive-error interrupt request (eri) disabled (initial value) 1 receive-data-full interrupt request (rxi) and receive-error interrupt request (eri) 5 transmit enable (te) 0 transmission disabled (initial value) 1 transmission enabled 4 receive enable (re) 0 reception disabled (initial value) 1 reception enabled 3 multiprocessor inter- rupt enable (mpie) 0 multiprocessor interrupts disabled (normal receive operation) (initial value) clear conditions: (1) mpie bit cleared to zero; (2) when data the mpb = 1 is received 1 multiprocessor interrupts enabled. disables receive interrupts (rxi), receive error interrupts (eri), and setting of rdrf, fer, and orer flags in ssr until data with a ? multiprocessor bit is received 2 transmit end inter- 0 transmit interrupt requests (tei) disabled (initial value) rupt enable (teie) 1 transmit interrupt requests (tei) enabled 1 clock enable 1 (cke1) 0 0 asynchronous mode internal clock/sck pin is input pin (input signal ignored) or output pin (output level undetermined) (initial value) synchronous mode internal clock/sck pin is synchronous clock output (initial value) 0 1 asynchronous mode internal clock/sck pin is clock output synchronous mode internal clock/sck pin is serial clock output 0 clock enable 0 (cke0) 1 0 asynchronous mode external clock/sck pin is clock input synchronous mode external clock/sck pin is serial clock input 1 1 asynchronous mode external clock/sck pin is clock input synchronous mode external clock/sck pin is serial clock input
568 a.2.4 transmit data register (tdr) sci ? start address: h'5fffec3 (channel 0), h'5fffecb (channel 1) ? bus width: 8/16 register overview: bit: 7 6 5 4 3 2 1 0 bit name: initial value: 1 1 1 1 1 1 1 1 r/w: r/w r/w r/w r/w r/w r/w r/w r/w table a.6 tdr bit functions bit bit name description 7? (transmit data storage) store data for serial transmission a.2.5 serial status register (ssr) sci ? start address: h'5fffec4 (channel 0), h'5fffecc (channel 1) ? bus width: 8/16 register overview: bit: 7 6 5 4 3 2 1 0 bit name: tdre rdrf orer fer per tend mpb mpbt initial value: 1 0 0 0 0 1 0 0 r/w: r/(w) * r/(w) * r/(w) * r/(w) * r/(w) * r r r/w note: * only 0 can be written, to clear the flags.
569 table a.7 ssr bit functions bit bit name value description 7 transmit data register empty (tdre) 0 indicates that valid transmit data has been written to tdr clear conditions: (1) 0 written in tdre after reading tdre = 1; (2) data written to tdr by dmac 1 indicates that there is no valid transmit data in tdr (initial value) set conditions: (1) reset or standby mode; (2) te bit of scr is 0; (3) data transferred to tsr from tdr and data writing to tdr enabled 6 receive data register full (rdrf) 0 indicates that there is no valid receive data stored in rdr (initial value) clear conditions: (1) reset or standby mode; (2) 0 written in rdrf after reading rdrf = 1; (3) data read in rdr by dmac 1 indicates that valid receive data is stored in rdr set conditions: serial reception ends normally and receive data is transferred to rdr from rsr 5 overrun error (orer) 0 indicates that reception is in progress or has ended normally (initial value) clear conditions: (1) reset or standby mode; (2) 0 written in orer after reading orer = 1 1 indicates that an overrun error occurred in reception set conditions: the next serial reception ends while rdrf = 1 4 framing error (fer) 0 indicates that reception is in progress or has ended normally (initial value) clear conditions: (1) reset or standby mode; (2) 0 written in fer after reading fer = 1 1 indicates that a framing error occurred in reception set conditions: when the stop bit at the end of the receive data when the sci finishes receiving has been checked to see if it is 1 and the stop bit is 0 3 parity error (per) 0 indicates that reception is in progress or has ended normally (initial value) clear conditions: (1) reset or standby mode; (2) 0 written in per after reading per = 1 1 indicates that a parity error occurred in reception set conditions: when the number of 1? in the receive data and parity bit together during reception is not consistent with the even/odd parity setting specified in the o/ e bit of the serial mode register (smr)
570 table a.11 ssr bit functions (cont) bit bit name value description 2 transmit end (tend) 0 indicates that transmission is in progress clear conditions: (1) 0 written in tdre after reading tdre = 1; (2) data written to tdr by dmac 1 indicates that transmission has ended (initial value) set conditions: (1) reset or standby mode; (2) te bit in scr is 0; (3) tdre = 1 when the final bit of a 1-byte serial transmit character is transmitted 1 multiprocessor bit (mpb) 0 indicates that data with multiprocessor bit = 0 has been received (initial value) 1 indicates that data with multiprocessor bit = 1 has been received 0 multiprocessor 0 0 transmitted as the multiprocessor bit (initial value) bit transfer (mpbt) 1 1 transmitted as the multiprocessor bit a.2.6 receive data register (rdr) sci ? start address: h'5fffec5 (channel 0), h'5fffecd (channel 1) ? bus width: 8/16 register overview: bit: 7 6 5 4 3 2 1 0 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: r r r r r r r r bit bit name description 7? (receive serial data storage) store the serial data received
571 a.2.7 a/d data register ah?l (addrah?ddrl) a/d ? start address: h'5fffee0, h'5fffee1, h'5fffee2, h'5fffee3, h'5fffee4, h'5fffee5, h'5fffee6, h'5fffee7 ? bus width: 8/16 register overview: bit: 15 14 13 12 11 10 9 8 bit name: ad9 ad8 ad7 ad6 ad5 ad4 ad3 ad2 initial value: 0 0 0 0 0 0 0 0 r/w: r r r r r r r r bit: 7 6 5 4 3 2 1 0 bit name: ad1 ad0 initial value: 0 0 0 0 0 0 0 0 r/w: r r r r r r r r table a.8 addrah?ddrl bit functions bit bit name description 15? a/d data 9? stores upper 8 bits of a/d conversion result 7,6 a/d data 1, 0 stores upper 2 bits of a/d conversion result a.2.8 a/d control/status register (adcsr) a/d ? start address: h'5fffef8 ? bus width: 8/16 register overview: bit: 7 6 5 4 3 2 1 0 bit name: adf adie adst scan cks ch2 ch1 ch0 initial value: 0 0 0 0 0 1 0 0 r/w: r/(w) * r/w r/w r/w r/w r/w r/w r/w note: * only 0 can be written, to clear the flag.
572 table a.9 adcsr bit functions bit bit name value description 7 a/d end flag (adf) 0 clear conditions: (1) 0 written in adf after reading adf = 1; (2) dmac started by adi interrupt and a/d converter register is accessed (initial value) 1 set conditions: (1) single mode: a/d conversion ends; (2) scan mode: a/d conversion of all channels set has ended 6 a/d interrupt enable (adf) 0 interrupt requested by a/d conversion (adi) disabled (initial value) 1 interrupt requested by a/d conversion (adi) enabled 5 a/d start (adst) 0 disable a/d conversion (initial value) 1 (1) single mode: start a/d conversion and when conversion ends, automatically cleared to zero; (2) scan mode: start a/d conversion and sequentially continue converting the selected channels until cleared to 0 by software, reset, or standby mode 4 scan mode (scan) 0 single mode (initial value) 1 scan mode 3 clock select (cks) 0 conversion time = 236 cycles (max) (initial value) 1 conversion time = 134 cycles (max) 2? channel select 2? ch2 ch1 ch0 single mode scan mode 0 0 0 an0 (initial value) an0 (initial value) 1 an1 an0, an1 1 0 an2 an0?n2 1 an3 an0?n3 1 0 0 an4 an4 1 an5 an4, an5 1 0 an6 an4?n6 1 an7 an4?n7
573 a.2.9 a/d control register (adcr) a/d ? start address: h'5fffee9 ? bus width: 8/16 register overview: bit: 7 6 5 4 3 2 1 0 bit name: trge initial value: 0 1 1 1 1 1 1 1 r/w: r/w table a.10 adcr bit functions bit bit name value description 7 trigger enable bit (trge) 0 start of a/d conversion by external trigger disabled (initial value) 1 start of a/d conversion by rising edge of external conversion trigger input pin ( adtrg ) enabled a.2.10 timer start register (tstr) itu ? start address: h'5ffff00 ? bus width: 8 register overview: bit: 7 6 5 4 3 2 1 0 bit name: str4 str3 str2 str1 str0 initial value: 1 1 1 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w
574 table a.11 tstr bit functions bit bit name value description 4 counter start 4 (str4) 0 count operation of tcnt4 stops (initial value) 1 tcnt4 counts 3 counter start 3 (str3) 0 count operation of tcnt 3 stops (initial value) 1 tcnt3 counts 2 counter start 2 (str2) 0 count operation of tcnt 2 stops (initial value) 1 tcnt2 counts 1 counter start 1 (str1) 0 count operation of tcnt 1 stops (initial value) 1 tcnt1 counts 0 counter start 0 (str0) 0 count operation of tcnt 0 stops (initial value) 1 tcnt0 counts a.2.11 timer synchronization register (tsnc) itu ? start address: h'5ffff01 ? bus width: 8 register overview: bit: 7 6 5 4 3 2 1 0 bit name: sync4 sync3 sync2 sync1 sync0 initial value: * 11 00 0 00 r/w: r/w r/w r/w r/w r/w note: * undetermined
575 table a.12 tsnc bit functions bit bit name value description 4 timer sync 4 (sync4) 0 independent operation of channel 4 timer counter (tcnt4) (initial value) (preset/clear of tcnt4 is unrelated to other channels) 1 channel 4 operation is synchronous. tcnt4 sync preset/sync clear enabled. 3 timer sync 3 (sync3) 0 independent operation of channel 3 timer counter (tcnt3) (initial value) (preset/clear of tcnt3 is unrelated to other channels) 1 channel 3 operation is synchronous. tcnt3 sync preset/sync clear enabled. 2 timer sync 2 (sync2) 0 independent operation of channel 2 timer counter (tcnt2) (initial value) (preset/clear of tcnt2 is unrelated to other channels) 1 channel 2 operation is synchronous. tcnt2 sync preset/sync clear enabled. 1 timer sync 1 (sync1) 0 independent operation of channel 1 timer counter (tcnt1) (initial value) (preset/clear of tcnt1 is unrelated to other channels) 1 channel 1 operation is synchronous. tcnt1 sync preset/sync clear enabled. 0 timer sync 0 (sync0) 0 independent operation of channel 0 timer counter (tcnt0) (initial value) (preset/clear of tcnt0 is unrelated to other channels) 1 channel 0 operation is synchronous. tcnt0 sync preset/sync clear enabled.
576 a.2.12 timer mode register (tmdr) itu ? start address: h'5ffff02 ? bus width: 8 register overview: bit: 7 6 5 4 3 2 1 0 bit name: mdf fdir pwm4 pwm3 pwm2 pwm1 pwm0 initial value: * 00 00 0 00 r/w: r/w r/w r/w r/w r/w r/w r/w note: * undetermined table a.13 tmdr bit functions bit bit name value description 6 phase counting mode (mdf) 0 channel 2 operates normally (initial value) 1 channel 2 in phase count mode 5 flag direction (fdir) 0 ovf of tsr2 set to 1 when tcnt2 overflows or underflows (initial value) 1 ovf in tsr2 set to 1 when tcnt2 overflows 4 pwm mode 4 (pwm4) 0 channel 4 operates normally (initial value) 1 channel 4 in pwm mode 3 pwm mode 3 (pwm3) 0 channel 3 operates normally (initial value) 1 channel 3 in pwm mode 2 pwm mode 2 (pwm2) 0 channel 2 operates normally (initial value) 1 channel 2 in pwm mode 1 pwm mode 1 (pwm1) 0 channel 1 operates normally (initial value) 1 channel 1 in pwm mode 0 pwm mode 0 (pwm0) 0 channel 0 operates normally (initial value) 1 channel 0 in pwm mode
577 a.2.13 timer function control register (tfcr) itu ? start address: h'5ffff03 ? bus width: 8 register overview: bit: 7 6 5 4 3 2 1 0 bit name: cmd1 cmd0 bfb4 bfa4 bfb3 bfa3 initial value: * 10 00 0 00 r/w: r/w r/w r/w r/w r/w r/w note: * undetermined table a.14 tfcr bit functions bit bit name value description 5,4 combination modes 1, 0 (cmd1, cmd0) 0 0 channel 3 and 4 operate normally (initial value) 0 1 channel 3 and 4 operate normally 1 0 channels 3 and 4 are combined to operate in complementary pwm mode 1 1 channels 3 and 4 are combined to operate in reset-synchronized pwm mode 3 buffer mode b4 (bfb4) 0 grb4 operates normally (initial value) 1 buffer operation of grb4 and brb4 2 buffer mode a4 (bfa4) 0 gra4 operates normally (initial value) 1 buffer operation of gra4 and bra4 1 buffer mode b3 (bfb3) 0 grb3 operates normally (initial value) 1 buffer operation of grb3 and brb3 0 buffer mode a3 (bfa3) 0 gra3 operates normally (initial value) 1 buffer operation of gra3 and bra3
578 a.2.14 timer control registers 0? (tcr0?cr4) itu ? start address: h'5ffff04 (channel 0), h'5ffff0e (channel 1), h'5ffff18 (channel 2), h'5ffff22 (channel 3), h'5ffff32 (channel 4) ? bus width: 8 register overview: bit: 7 6 5 4 3 2 1 0 bit name: cclr1 cclr0 ckeg1 ckeg0 tpsc2 tpsc1 tpsc0 initial value: * 00 00 0 00 r/w: r/w r/w r/w r/w r/w r/w r/w note: * undetermined table a.15 tcr0?cr4 bit functions bit bit name value description 6,5 counter clear 1, 0 (cclr1, 0 0 tcnt clear disabled (initial value) cclr0) 0 1 tcnt cleared upon gra compare match/input capture 1 0 tcnt cleared upon grb compare match/input capture 1 1 synchronized clear. tcnt cleared in synchronization with counter clear of other timers operating in sync 4,3 clock edge 1, 0 (ckeg1, 0 0 count on rising edge (initial value) ckeg0) 0 1 count on falling edge 1 * count on both rising and falling edges 2? timer prescaler 2? 0 0 0 internal clock: count on (initial value) (tpsc2?psc0) 0 0 1 internal clock: count on /2 0 1 0 internal clock: count on /4 0 1 1 internal clock: count on /8 1 0 0 external clock a: count on tclka pin input 1 0 1 external clock b: count on tclkb pin input 1 1 0 external clock c: count on tclkc pin input 1 1 1 external clock d: count on tclkd pin input note: * 0 or 1
579 a.2.15 timer i/o control registers 0? (tior0?ior4) itu ? start address: h'5ffff05 (channel 0), h'5ffff0f (channel 1), h'5ffff19 (channel 2), h'5ffff23 (channel 3), h'5ffff33 (channel 4) ? bus width: 8 register overview: bit: 7 6 5 4 3 2 1 0 bit name: iob2 iob1 iob0 ioa2 ioa1 ioa0 initial value: * 00 01 0 00 r/w: r/w r/w r/w r/w r/w r/w note: * undetermined table a.16 tio0?io4 bit functions bit bit name value description 6? i/o control b2? (iob2?ob0) 0 0 0 grb is output compare register pin output due to compare match disabled (initial value) 0 0 1 0 output on grb compare match 0 1 0 1 output on grb compare match 0 1 1 toggle output on grb compare match (1 output on channel 2 only) 1 0 0 grb is input input capture to grb on rising edge 101 capture register input capture to grb on falling edge 11 * input capture on both rising and falling edges 2? i/o control a2? (ioa2?oa0) 0 0 0 gra is output compare register pin output due to compare match disabled (initial value) 0 0 1 0 output on gra compare match 0 1 0 1 output on gra compare match 0 1 1 toggle output on gra compare match (1 output on channel 2 only) 1 0 0 gra is input input capture to gra on rising edge 101 capture register input capture to gra on falling edge 11 * input capture on both rising and falling edges note: * 0 or 1
580 a.2.16 timer interrupt enable registers 0? (tier0?ier4) itu ? start address: h'5ffff06 (channel 0), h'5ffff10 (channel 1), h'5ffff1a (channel 2), h'5ffff24 (channel 3), h'5ffff34 (channel 4), ? bus width: 8 register overview: bit: 7 6 5 4 3 2 1 0 bit name: ovie imieb imiea initial value: * 11 11 0 00 r/w: r/w r/w r/w note: * undetermined table a.17 tier0?ier4 bit functions bit bit name value description 2 overflow interrupt enable (ovie) 0 interrupt request by ovf (ovi) disabled (initial value) 1 interrupt request by ovf (ovi) enabled 1 input capture/compare match interrupt enable b (imieb) 0 interrupt request by imfb (imib) disabled (initial value) 1 interrupt request by imfb (imib) enabled 0 input capture/compare match interrupt enable a (imiea) 0 interrupt request by imfa (imia) disabled (initial value) 1 interrupt request by imfa (imia) enabled
581 a.2.17 timer status registers 0? (tsr0?sr4) itu ? start address: h'5ffff07 (channel 0), h'5ffff11 (channel 1), h'5ffff1b (channel 2), h'5ffff25 (channel 3), h'5ffff35 (channel 4), ? bus width: 8 register overview: bit: 7 6 5 4 3 2 1 0 bit name: ovf imfb imfa initial value: * 1 11 11 0 00 r/w: r/(w) * 2 r/(w) * 2 r/(w) * 2 notes: * 1 undetermined * 2 only 0 can be written, to clear the flag. table a.18 tsr0?sr4 bit functions bit bit name value description 2 overflow flag (ovf) 0 clear conditions: 0 is written in ovf after reading ovf = 1 (initial value) 1 set conditions: tcnt value overflows (h'ffff h'0000) or underflows (h'ffff h'0000) 1 input capture/compare match flag b (imfb) 0 clear conditions: 0 is written in imfb after reading imfb = 1 (initial value) 1 set conditions: (1) when grb is functioning as the output compare register, and tcnt = grb; (2) when grb is functioning as the input capture register, and the tcnt value is transferred to grb by the input capture signal 0 input capture/compare match flag a (imfa) 0 clear conditions: 0 is written in imfa after reading imfa = 1 (initial value) 1 set conditions: (1) when gra is functioning as the output compare register, and tcnt = gra; (2) when gra is functioning as the input capture register, and the tcnt value is transferred to gra by the input capture signal
582 a.2.18 timer counter 0? (tcnt0?cnt4) itu ? start address: h'5ffff08 (channel 0), h'5ffff12 (channel 1), h'5ffff1c (channel 2), h'5ffff26 (channel 3), h'5ffff36 (channel 4) ? bus width: 8/16/32 register overview: bit: 15 14 13 12 11 10 9 8 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w table a.19 tcnt0?cnt4 bit functions bit bit name description 15? (count value) count input clocks
583 a.2.19 general registers a0? (gra0?ra4) itu ? start address: h'5ffff0a (channel 0), h'5ffff14 (channel 1), h'5ffff1e (channel 2), h'5ffff28 (channel 3), h'5ffff38 (channel 4) ? bus width: 8/16/32 register overview: bit: 15 14 13 12 11 10 9 8 bit name: initial value: 1 1 1 1 1 1 1 1 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: initial value: 1 1 1 1 1 1 1 1 r/w: r/w r/w r/w r/w r/w r/w r/w r/w table a.20 gra0?ra4 bit functions bit bit name description 15? registers used for both output compare and input capture output compare register: set with compare match output input capture register: stores the tcnt value when the input capture signal is generated
584 a.2.20 general registers b0? (grb0?rb4) itu ? start address: h'5ffff0c (channel 0), h'5ffff16 (channel 1), h'5ffff20 (channel 2), h'5ffff2a (channel 3), h'5ffff3a (channel 4) ? bus width: 8/16/32 register overview: bit: 15 14 13 12 11 10 9 8 bit name: initial value: 1 1 1 1 1 1 1 1 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: initial value: 1 1 1 1 1 1 1 1 r/w: r/w r/w r/w r/w r/w r/w r/w r/w table a.21 grb0?rb4 bit functions bit bit name description 15? registers used for both output compare and input capture output compare register: set with compare match output input capture register: stores the tcnt value when the input capture signal is generated
585 a.2.21 buffer registers a3, 4 (bra3, bra4) itu ? start address: h'5ffff2c (channel 3), h'5ffff3c (channel 4) ? bus width: 8/16/32 register overview: bit: 15 14 13 12 11 10 9 8 bit name: initial value: 1 1 1 1 1 1 1 1 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: initial value: 1 1 1 1 1 1 1 1 r/w: r/w r/w r/w r/w r/w r/w r/w r/w table a.22 bra3, bra4 bit functions bit bit name description 15? buffer registers used for output compare/input capture output compare register: transfers to gra the value stored up to compare match generation input capture register: stores the value stored in gra up to input capture signal generation
586 a.2.22 buffer registers b3, 4 (brb3, brb4) itu ? start address: h'5ffff2e (channel 3), h'5ffff3e (channel 4) ? bus width: 8/16/32 register overview: bit: 15 14 13 12 11 10 9 8 bit name: initial value: 1 1 1 1 1 1 1 1 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: initial value: 1 1 1 1 1 1 1 1 r/w: r/w r/w r/w r/w r/w r/w r/w r/w table a.23 brb3, brb4 bit functions bit bit name description 15? buffer registers used for output compare/input capture output compare register: transfers to grb the value stored up to compare match generation input capture register: stores the value stored in grb up to input capture signal generation
587 a.2.23 timer output control register (tocr) itu ? start address: h'5ffff31 ? bus width: 8 register overview: bit: 7 6 5 4 3 2 1 0 bit name: ols4 ols3 initial value: * 11 11 1 11 r/w: r/w r/w note: * undetermined table a.24 tocr bit functions bit bit name value description 1 output level select 4 (ols4) 0 reverse output of tioca3, tioca4, tiocb4 1 direct output of tioca3, tioca4, tiocb4 (initial value) 0 output level select 3 (ols3) 0 reverse output of tiocb3, tocxa4, tocxb4 1 direct output of tiocb3, tocxa4, tocxb4 (initial value)
588 a.2.24 dma source address registers 0? (sar0?ar3) dmac ? start address: h'5ffff40 (channel 0), h'5ffff50 (channel 1), h'5ffff60 (channel 2), h'5ffff70 (channel 3) ? bus width: 16/32 register overview: bit: 31 30 29 28 27 26 25 24 bit name: initial value: ******** r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 23 22 21 20 19 18 17 16 bit name: initial value: ******** r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 15 14 13 12 11 10 9 8 bit name: initial value: ******** r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: initial value: ******** r/w: r/w r/w r/w r/w r/w r/w r/w r/w note: * undetermined table a.25 sar0?ar3 bit functions bit bit name description 31? (specifies transfer source address) specifies the address of the dma transfer source
589 a.2.25 dma destination address registers 0? (dar0?ar3) dmac ? start address: h'5ffff44 (channel 0), h'5ffff54 (channel 1), h'5ffff64 (channel 2), h'5ffff74 (channel 3) ? bus width: 16/32 register overview: bit: 31 30 29 28 27 26 25 24 bit name: initial value: ******** r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 23 22 21 20 19 18 17 16 bit name: initial value: ******** r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 15 14 13 12 11 10 9 8 bit name: initial value: ******** r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: initial value: ******** r/w: r/w r/w r/w r/w r/w r/w r/w r/w note: * undetermined table a.26 dar0?ar3 bit functions bit bit name description 31? (specifies transfer destination address) specifies the address of the dma transfer destination
590 a.2.26 dma transfer count registers 0? (tcr0?cr3) dmac ? start address: h'5ffff4a (channel 0), h'5ffff5a (channel 1), h'5ffff6a (channel 2), h'5ffff7a (channel 3) ? bus width: 16/32 register overview: bit: 15 14 13 12 11 10 9 8 bit name: initial value: ******** r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: initial value: ******** r/w: r/w r/w r/w r/w r/w r/w r/w r/w note: * undetermined table a.27 tcr0?cr3 bit functions bit bit name description 15? (specifies number of dma transfers) specifies the number of dma transfers (bytes or words). during dma transfer, indicates the number of transfers remaining.
591 a.2.27 dma channel control registers 0? (chcr0?hcr3) dmac ? start address: h'5ffff4e (channel 0), h'5ffff5e (channel 1), h'5ffff6e (channel 2), h'5ffff7e (channel 3) ? bus width: 8/16/32 register overview: bit: 15 14 13 12 11 10 9 8 bit name: dm1 dm0 sm1 sm0 rs3 rs2 rs1 rs0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: am al ds tm ts ie te de initial value: 0 0 0 0 0 0 0 0 r/w: r/w * 2 r/w * 2 r/w * 2 r/w r/w r/w r/(w) * 1 r/w notes: * 1 only 0 can be written, to clear the flag. * 2 writing is valid only for chcr0 and chcr1.
592 table a.28 chcr0?hcr3 bit functions bit bit name value description 15,14 destination address 0 0 destination address is fixed (initial value) mode bits 1, 0 (dm1, dm0) 0 1 destination address incremented (+1 for byte transfer; +2 for word transfer) 1 0 destination address decremented (? for byte transfer; ? for word transfer) 1 1 reserved (cannot be set) 13,12 source address mode 0 0 source address is fixed (initial value) bits 1, 0 (sm1, sm0) 0 1 source address incremented (+1 for byte transfer; +2 for word transfer) 1 0 source address decremented (? for byte transfer; ? for word transfer) 1 1 reserved (cannot be set) 11? resource select bits 3? (rs3?s0) 0000 dreq (external request * 1 ) (initial value) (dual address mode) 0001 reserved (cannot be set) 0010 dreq (external request * 1 ) (single address mode * 2 ) 0011 dreq (external request * 1 ) (single address mode * 3 ) 0100 rxio (transfer request by receive-data-full interrupt of on-chip sci0) * 4 0101 txio (transfer request by transmit-data-empty interrupt of on-chip sci0) * 4 0110 rxi1 (transfer request by receive-data-full interrupt of on-chip sci1) * 4 0111 txi1 (transfer request by transmit-data-empty interrupt of on-chip sci1) * 4 1000 imia0 (input capture a/compare match a interrupt request of on-chip itu0) * 4 1001 imia1 (input capture a/compare match a interrupt request of on-chip itu1) * 4 1010 imia2 (input capture a/compare match a interrupt request of on-chip itu2) * 4
593 table a.28 chcr0?hcr3 bit functions (cont) bit bit name value description 11? resource select bits 3? (rs3?s0) (cont) 1 0 1 1 imia3 (input capture a/compare match a interrupt request of on-chip itu3) * 4 1 1 0 0 auto request (transfer request automatically generated within dmac) * 4 1 1 0 1 adi (a/d conversion end interrupt request of on-chip a/d converter) 1 1 1 0 reserved (cannot be set) 1 1 1 1 reserved (cannot be set) 7 acknowledge mode 0 dack output in read cycle (initial value) bit (am) * 1 1 dack output in write cycle 6 acknowledge level 0 dack is active-high signal (initial value) bit (al) * 1 1 dack is active-low signal 5 dreq select bit 0 dreq detected at low (initial value) (ds) * 1 1 dreq detected on falling edge 4 transfer bus mode bit 0 cycle-steal mode (initial value) (tm) 1 burst mode 3 transfer size bit (ts) 0 byte (8 bits) (initial value) 1 word (16 bits) 2 interrupt enable bit 0 interrupt request disabled (initial value) (ie) 1 interrupt request enabled 1 transfer end flag bit (te) 0 dma transferring or dma transfer halted (initial value) clear conditions: te bit read and then 0 written in te 1 dma transfer ends normally 0 dma enable bit (de) 0 dma transfer disabled (initial value) 1 dma transfer enabled notes: * 1 only valid in channels 0 and 1. * 2 transfer to external device from memory mapped external device or external memory with dack. * 3 transfer from external device to memory mapped external device or external memory with dack. * 4 dual address mode.
594 a.2.28 dma operation registers (dmaor) dmac ? start address: h'5ffff48 ? bus width: 8/16/32 register overview: bit: 15 14 13 12 11 10 9 8 bit name: pr1 pr0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: ae nmif dme initial value: 0 0 0 0 0 0 0 0 r/w: r/(w) * r/(w) * r/w note: * only 0 can be written, to clear the flag. table a.29 dmaor bit functions bit bit name value description 9,8 priority mode bits 1, 0 (pr1,pr0) 0 0 priority order is fixed (initial value) (channel 0 > channel 3 > channel 2 > channel 1) 0 1 priority order is fixed (channel 1 > channel 3 > channel 2 > channel 0) 1 0 round-robin priority order (immediately after reset: channel 0 > channel 3 > channel 2 > channel 1) 1 1 external-pin-alternating mode priority order (immediately after reset: channel 3 > channel 2 > channel 1 > channel 0) 2 address error flag bit (ae) 0 no errors caused by dmac (initial value) clear condition: write 0 in ae after reading ae 1 address error caused by dmac 1 nmi flag bit (nmif) 0 no nmi interrupt (initial value) clear condition: write 0 in nmif after reading nmif 1 nmi interrupt generated 0 dma master enable 0 dma transfer disabled for all channels (initial value) bit (dme) 1 dma transfer enabled for all channels
595 a.2.29 interrupt priority setting register a (ipra) intc ? start address: h'5ffff84 ? bus width: 8/16/32 register overview: bit: 15 14 13 12 11 10 9 8 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w table a.30 ipra bit functions bit bit name description 15?2 (set irq0 priority level) sets the irq0 priority level value 11? (set irq1 priority level) sets the irq1 priority level value 7? (set irq2 priority level) sets the irq2 priority level value 3? (set irq3 priority level) sets the irq3 priority level value
596 a.2.30 interrupt priority setting register b (iprb) intc ? start address: h'5ffff86 ? bus width: 8/16/32 register overview: bit: 15 14 13 12 11 10 9 8 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w table a.31 iprb bit functions bit bit name description 15?2 (set irq4 priority level) sets the irq4 priority level value 11? (set irq5 priority level) sets the irq5 priority level value 7? (set irq6 priority level) sets the irq6 priority level value 3? (set irq7 priority level) sets the irq7 priority level value
597 a.2.31 interrupt priority setting register c (iprc) intc ? start address: h'5ffff88 ? bus width: 8/16/32 register overview: bit: 15 14 13 12 11 10 9 8 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w table a.32 iprc bit functions bit bit name description 15?2 (set dmac0 and dmac1 priority levels) sets the dmac0 and dmac1 priority level values 11? (set dmac2 and dmac3 priority levels) sets the dmac2 and dmac3 priority level values 7? (set itu0 priority level) sets the itu0 priority level value 3? (set itu1 priority level) sets the itu1 priority level value
598 a.2.32 interrupt priority setting register d (iprd) intc ? start address: h'5ffff8a ? bus width: 8/16/32 register overview: bit: 15 14 13 12 11 10 9 8 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w table a.33 iprd bit functions bit bit name description 15?2 (set itu2 priority level) sets the itu2 priority level value 11? (set itu3 priority level) sets the itu3 priority level value 7? (set itu4 priority level) sets the itu4 priority level value 3? (set sci0 priority level) sets the sci0 priority level value
599 a.2.33 interrupt priority setting register e (ipre) intc ? start address: h'5ffff8c ? bus width: 8/16/32 register overview: bit: 15 14 13 12 11 10 9 8 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w table a.34 ipre bit functions bit bit name description 15?2 (set sci1 priority level) sets the sc1 priority level value 11? (set prt * 1 and a/d priority levels) sets the prt * 1 and a/d priority level values 7? (set wdt and ref * 2 priority levels) sets the wdt and ref * 2 priority level value notes * 1 prt: parity control section within the bus state controller. see section 8, bus state controller (bsc), for more information. * 2 ref: dram refresh control section within the bus state controller. see section 8, bus state controller (bsc), for more information.
600 a.2.34 interrupt control register (icr) intc ? start address: h'5ffff8e ? bus width: 8/16/32 register overview: bit: 15 14 13 12 11 10 9 8 bit name: nmil nmie initial value: * 00 00 0 00 r/w: r r/w bit: 7 6 5 4 3 2 1 0 bit name: irq0s irq1s irq2s irq3s irq4s irq5s irq6s irq7s initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w note: * nmi pin input high: 1 nmi pin input low: 0 table a.35 icr bit functions bit bit name value description 15 nmi input level (nmil) 0 low input to nmi pin 1 high input to nmi pin 8 nmi edge select (nmie) 0 interrupt request sensed at falling edge of nmi input (initial value) 1 interrupt request sensed at rising edge of nmi input 7? irq0? sense select (irq0?rq7) 0 interrupt request sensed at irq input low level (initial value) 1 interrupt request sensed at irq input falling edge
601 a.2.35 break address register h (barh) ubc ? start address: h'5ffff90 ? bus width: 8/16/32 register overview: bit: 15 14 13 12 11 10 9 8 bit name: ba31 ba30 ba29 ba28 ba27 ba26 ba25 ba24 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: ba23 ba22 ba21 ba20 ba19 ba18 ba17 ba16 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w table a.36 barh bit functions bit bit name description 15? set break address bits 31?6 (ba31?a16) specifies the upper end (bits 31?6) of the address which is the break condition
602 a.2.36 break address register l (barl) ubc ? start address: h'5ffff92 ? bus width: 8/16/32 register overview: bit: 15 14 13 12 11 10 9 8 bit name: ba15 ba14 ba13 ba12 ba11 ba10 ba9 ba8 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: ba7 ba6 ba5 ba4 ba3 ba2 ba1 ba0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w table a.37 barl bit functions bit bit name description 15? set break address bits 15? (ba15?a0) specifies the lower end (bits 15?) of the address which is the break condition
603 a.2.37 break address mask register h (bamrh) ubc ? start address: h'5ffff94 ? bus width: 8/16/32 register overview: bit: 15 14 13 12 11 10 9 8 bit name: bam31 bam30 bam29 bam28 bam27 bam26 bam25 bam24 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: bam23 bam22 bam21 bam20 bam19 bam18 bam17 bam16 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w table a.38 bamrh bit functions bit bit name description 15? break address masks 31?6 (bam31?am16) specifies the bits to be masked in the break address specified in barh
604 a.2.38 break address mask register l (bamrl) ubc ? start address: h'5ffff96 ? bus width: 8/16/32 register overview: bit: 15 14 13 12 11 10 9 8 bit name: bam15 bam14 bam13 bam12 bam11 bam10 bam9 bam8 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: bam7 bam6 bam5 bam4 bam3 bam2 bam1 bam0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w table a.39 bamrl bit functions bit bit name description 15? break address masks 15? (bam15?am0) specifies the bits to be masked in the break address specified in barl
605 a.2.39 break bus cycle register (bbr) ubc ? start address: h'5ffff98 ? bus width: 8/16/32 register overview: bit: 15 14 13 12 11 10 9 8 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: bit: 7 6 5 4 3 2 1 0 bit name: cd1 cd0 id1 id0 rw1 rw0 sz1 sz0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w table a.40 bbr bit functions bit bit name value description 7,6 cpu cycle/dma cycle 0 0 user break interrupt not generated (initial value) select (cd1, cd0) 0 1 cpu cycle is break condition 1 0 dma cycle is break condition 1 1 cpu cycle and dma cycle are both break conditions 5,4 0 0 user break interrupt not generated (initial value) 0 1 instruction fetch cycle is break condition 1 0 data access cycle is break condition 1 1 instruction fetch cycle and data access cycle are both break conditions 3,2 read/write select 0 0 user break interrupt not generated (initial value) (rw1, rw0) 0 1 read cycle is break condition 1 0 write cycle is break condition 1 1 read cycle and write cycle are both break conditions 1,0 operand size select (sz1, sz0) 0 0 operand size not included in the break conditions (initial value) 0 1 byte access is break condition 1 0 word access is break condition 1 1 longword access is break condition instruction fetch/data access select (id1, id0)
606 a.2.40 bus control register (bcr) bsc ? start address: h'5ffffa0 ? bus width: 8/16/32 register overview: bit: 15 14 13 12 11 10 9 8 bit name: drame ioe warp rddty bas initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: table a.41 bcr bit functions bit bit name value description 15 dram enable (drame) 0 area 1 is external memory space (initial value) 1 area 1 is dram space 14 multiplex i/o enable (ioe) 0 area 6 is external memory space (initial value) 1 area 6 is address/data multiplex i/o space 13 warp mode (warp) 0 normal mode: external access and internal access not performed simultaneously (initial value) 1 warp mode: external access and internal access performed simultaneously 12 rd duty (rddty) 0 rd signal high width duty ratio is 50% (initial value) 1 rd signal high width duty ratio is 35% 11 byte access select (bas) 0 wrh , wrl , and a0 signals valid (initial value) 1 wr , hbs , and lbs and signals valid
607 a.2.41 wait state control register 1 (wcr1) bsc ? start address: h'5ffffa2 ? bus width: 8/16/32 register overview: bit: 15 14 13 12 11 10 9 8 bit name: rw7 rw6 rw5 rw4 rw3 rw2 rw1 rw0 initial value: 1 1 1 1 1 1 1 1 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: ww1 initial value: 1 1 1 1 1 1 1 1 r/w: r/w * note: * only write 0 in the ww1 bit when area 1 is dram space. when it is external memory space, do not write 0. table a.42 wcr bit functions number of read cycles wait external space internal space bit bit name value pin signal input external memory space dram space multi- plex i/o on-chip modules on-chip rom, ram 15? read wait state control (rw7?w0) 0 not sampled during read cycle ? areas 1, 3?, 7: fixed at 1 cycle ? areas 0, 2, 6: 1 cycle + long wait state column address cycle: fixed at 1 cycle (short-pitch) wait state is 4 cycles plus wait fixed at 3 cycles fixed at 1 cycle 1 sampled during read cycle (initial value) ? areas 1, 3?, 7: wait state is 2 cycles plus wait ? areas 0, 2, 6: 1 cycle + long wait state, or wait state from wait column address cycle: wait state is 2 cycles plus wait (long- pitch) *
608 table a.42 bit functions (cont) description bit bit name value dram space (bcrdrame = 1) area 1 external memory space (bcrdrame = 1) 1 write wait state control 0 column address cycle: 1 cycle (short-pitch) setting prohibited (ww1) 1 column address cycle: wait state is 2 cycles + wait (long-pitch) (initial value) wait state is 2 cycles + wait note: * during a cbr refresh, the wait signal is ignored and the wait state inserted using the rlw1 and rlw0 bits. a.2.42 wait state control register 2 (wcr2) bsc ? start address: h'5ffffa4 ? bus width: 8/16/32 register overview: bit: 15 14 13 12 11 10 9 8 bit name: drw7 drw6 drw5 drw4 drw3 drw2 drw1 drw0 initial value: 1 1 1 1 1 1 1 1 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: dww7 dww6 dww5 dww4 dww3 dww2 dww1 dww0 initial value: 1 1 1 1 1 1 1 1 r/w: r/w r/w r/w r/w r/w r/w r/w r/w
609 table a.43 wcr2 bit functions description number of single mode dma external space cycle states bit bit name value wait pin signal input external memory space dram space multiplex i/o 15? single mode dma memory read wait state control (drw7 drw0) 0 not sampled during single mode dma memory read cycle ? areas 1, 3?, 7: fixed at 1 cycle ? areas 0, 2, 6: 1 cycle + long wait state column address cycle: fixed at 1 cycle (short- pitch) wait state is 4 cycles plus wait 1 sampled during single mode dma memory read cycle (initial value) ? areas 1, 3?, 7: wait state is 2 cycles plus wait ? areas 0, 2, 6: 1 cycle + long wait state, or wait state from wait column address cycle: wait state is 2 cycles plus wait (long- pitch) 7? single mode dma memory write wait state control (dww7 dww0) 0 not sampled during single mode dma memory write cycle ? areas 1, 3?, 7: fixed at 1 cycle ? areas 0, 2, 6: 1 cycle + long wait state column address cycle: fixed at 1 cycle (short- pitch) wait state is 4 cycles plus wait 1 sampled during single mode dma memory write cycle (initial value) ? areas 1, 3?, 7: wait state is 2 cycles plus wait ? areas 0, 2, 6: 1 cycle + long wait state, or wait state from wait column address cycle: wait state is 2 cycles plus wait (long- pitch)
610 a.2.43 wait state control register 3 (wcr3) bsc ? start address: h'5ffffa6 ? bus width: 8/16/32 register overview: bit: 15 14 13 12 11 10 9 8 bit name: wpu a02lw1 a02lw0 a6lw1 a6lw0 initial value: 1 1 1 1 1 0 0 0 r/w: r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: table a.44 wcr3 bit functions bit bit name value description 15 wait pin pull-up control (wpu) 0 wait pin not pulled up 1 wait pin pulled up (initial value) 14,13 areas 0 and 2 long wait insert 1, 0 (a02lw1, a02lw0) 0 0 1-cycle long wait state inserted 0 1 2-cycle long wait state inserted 1 0 3-cycle long wait state inserted 1 1 4-cycle long wait state inserted (initial value) 12,11 area 6 long wait insert 1, 0 (a6lw1, a6lw0) 0 0 1-cycle long wait state inserted 0 1 2-cycle long wait state inserted 1 0 3-cycle long wait state inserted 1 1 4-cycle long wait state inserted (initial value)
611 a.2.44 dram area control register (dcr) bsc ? start address: h'5ffffa8 ? bus width: 8/16/32 register overview: bit: 15 14 13 12 11 10 9 8 bit name: cw2 rasd tpc be cdty mxe mxc1 mxc0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: initial value: 0 0 0 0 0 0 0 0 r/w:
612 table a.45 dcr bit functions bit bit name value description 15 2-cas system/2-we system (cw2) 0 2-cas system: cash , casl , and wrl signals are valid (initial value) 1 2-we system: casl , wrh , and wrl signals are valid 14 ras down (rasd) 0 ras up mode: returns ras signal to high and waits for next dram access (initial value) 1 ras down mode: leaves ras signal low and waits for next dram access 13 number of ras pre-charge 0 1-cycle pre-charge cycle inserted (initial value) cycles (tpc) 1 2-cycle pre-charge cycle inserted 12 burst operation enable (be) 0 normal mode: full access (initial value) 1 high-speed page mode: burst operation 11 cas duty (cdty) 0 cas signal high width duty ratio is 50% (initial value) 1 cas signal high width duty ratio is 35% 10 multiplex enable (mxe) 0 row address and column address not multiplexed (initial value) 1 row address and column address multiplexed 9,8 multiplex shift count 1,0 (mxc1, mxc0) row address shift (mxe = 1) row address for comparison during burst (mxe = 0 or 1) 0 0 8 bits (initial value) a27?8 (initial value) 0 1 9 bits a27?9 1 0 10 bits a27?10 1 1 reserved reserved
613 a.2.45 parity control register (pcr) bsc ? start address: h'5ffffaa ? bus width: 8/16/32 register overview: bit: 15 14 13 12 11 10 9 8 bit name: pef pfrc peo pchk1 pchk0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: table a.46 pcr bit functions bit bit name value description 15 parity error flag (pef) 0 no parity error (initial value) clear condition: pef read, then 0 written in pef 1 parity error occurred 14 parity forced output 0 no forced parity output (initial value) (pfrc) 1 forced high-level output 13 parity polarity (peo) 0 even parity (initial value) 1 odd parity 12,11 parity check enable 1, 0 0 0 parity not checked or generated (initial value) (pchk1, pchk0) 0 1 parity checked and generated in dram space 1 0 parity checked and generated in dram space and area 2 1 1 reserved
614 a.2.46 refresh control register (rcr) bsc ? start address: h'5ffffac ? bus width: 8/16/32 (read), 16 (write) register overview: bit: 15 14 13 12 11 10 9 8 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: bit: 7 6 5 4 3 2 1 0 bit name: rfshe rmode rlw1 rlw0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w table a.47 rcr bit functions bit bit name value description 7 refresh control (rfshe) 0 no refresh control (initial value) (rtcnt can be used as an interval timer) 1 refresh control 6 refresh mode (rmode) 0 cas-before-ras refresh performed (initial value) 1 self-refresh performed 5,4 wait state insertion cbr 0 0 1-cycle wait state inserted (initial value) refresh 1,0 (rlw1, rlw0) 0 1 2-cycle wait state inserted 1 0 3-cycle wait state inserted 1 1 4-cycle wait state inserted
615 a.2.47 refresh timer control/status register (rtcsr) bsc ? start address: h'5ffffae ? bus width: 8/16/32 (read), 16 (write) register overview: bit: 15 14 13 12 11 10 9 8 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: bit: 7 6 5 4 3 2 1 0 bit name: cmf cmie cks2 cks1 cks0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w table a.48 rstcr bit functions bit bit name value description 7 compare match flag (cmf) 0 rtcnt and rtcor values do not match(initial value) clear condition: cmf read, then 0 written in cmf 1 rtcnt and rtcor values match 6 compare match interrupt 0 compare match interrupt (cmi) disabled (initial value) enable (cmie) 1 compare match interrupt (cmi) enabled 5? clock select 2? (cks2 0 0 0 clock input disabled (initial value) cks0) 001 /2 010 /8 011 /32 100 /128 101 /512 110 /2048 111 /4096
616 a.2.48 refresh timer counter (rtcnt) bsc ? start address: h'5ffffb0 ? bus width: 8/16/32 (read), 16 (write) register overview: bit: 15 14 13 12 11 10 9 8 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: bit: 7 6 5 4 3 2 1 0 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w table a.49 rtcnt bit functions bit bit name description 7? (count value) input clock count value
617 a.2.49 refresh timer constant register (rtcor) bsc ? start address: h'5ffffb2 ? bus width: 8/16/32 (read), 16 (write) register overview: bit: 15 14 13 12 11 10 9 8 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: bit: 7 6 5 4 3 2 1 0 bit name: initial value: 1 1 1 1 1 1 1 1 r/w: r/w r/w r/w r/w r/w r/w r/w r/w table a.50 rtcor bit functions bit bit name description 7? (compare match cycle) set with compare match cycle a.2.50 timer control/status register (tcsr) wdt ? start address: h'5ffffb8 ? bus width: 8 (read), 16 (write) register overview: bit: 7 6 5 4 3 2 1 0 bit name: ovf wt/ it tme cks2 cks1 cks0 initial value: 0 0 0 1 1 0 0 0 r/w: r/(w) * r/w r/w r/w r/w r/w note: * only 0 can be written, to clear the flag.
618 table a.51 tcsr bit functions bit bit name value description 7 overflow flag (ovf) 0 no tcnt overflow in interval timer mode (initial value) clear condition: ovf read, then 0 written in ovf 1 tcnt overflow generated in interval timer mode 6 timer mode select (wt/ it ) 0 interval timer mode: when tcnt overflows, interval timer interrupt (iti) request sent to cpu (initial value) 1 watchdog timer mode: when tcnt overflows, wdtovf signal is output externally * 5 timer enable (tme) 0 timer disable: tcnt initialized at h'00 and count- up halted (initial value) 1 timer enable: tcnt starts counting up. when tcnt overflows, a wdtovf signal or interrupt is generated 2? clock select 2? clock overflow cycle ( =20 mhz) (cks2?ks0) 000 /2 (initial value) 25.6 s 001 /64 819.2 s 010 /128 1.6 ms 011 /256 3.3 ms 000 /512 6.6 ms 001 /1024 13.1 ms 010 /4096 52.4 ms 011 /8192 104.9 ms note: * when the rste bit in rstcsr is 1, an internal reset signal is also generated simultaneously with the wdtovf signal when tcnt overflows in watchdog timer mode.
619 a.2.51 timer counter (tcnt) wdt ? start address: h'5ffffb9 (read), h'5ffffb8 (write) ? bus width: 8 (read), 16 (write) register overview: bit: 7 6 5 4 3 2 1 0 bit name: initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w table a.52 tcnt bit functions bit bit name description 7? count value input clock count value a.2.52 reset control/status register (rstcsr) wdt ? start address: h'5ffffbb (read), h'5ffffba (write) ? bus width: 8 (read), 16 (write) register overview: bit: 7 6 5 4 3 2 1 0 bit name: wovf rste rsts initial value: 0 0 0 1 1 1 1 1 r/w: r/(w) * r/w r/w note: * only 0 can be written, to clear the flag.
620 table a.53 rstcsr bit functions bit bit name value description 7 watchdog timer overflow flag (wovf) 0 no tcnt overflow in watchdog timer mode (initial value) clear condition: wovf read, then 0 written in wovf 1 tcnt overflow generated in watchdog timer mode 6 reset enable (rste) 0 no internal reset when tcnt overflows * (initial value) 1 internal reset when tcnt overflows 5 reset select (rsts) 0 power-on reset (initial value) 1 manual reset note: * the microprocessor is not reset internally, but tcnt and tcsr within the wdt are reset. a.2.53 standby control register (sbycr) power-down state ? start address: h'5ffffbc ? bus width: 8/16/32 register overview: bit: 7 6 5 4 3 2 1 0 bit name: sby hiz initial value: 0 0 0 1 1 1 1 1 r/w: r/w r/w table a.54 sbycr bit functions bit bit name value description 7 standby (sby) 0 shift to sleep mode on execution of sleep instruction (initial value) 1 shift to standby mode on execution of sleep instruction 6 port high impedance (hiz) 0 pin states held in standby mode (initial value) 1 pins change to high impedance in standby mode
621 a.2.54 port a data register (padr) port a ? start address: h'5ffffc0 ? bus width: 8/16/32 register overview: bit: 15 14 13 12 11 10 9 8 bit name: pa15dr pa14dr pa13dr pa12dr pa11dr pa10dr pa9dr pa8dr initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: pa7dr pa6dr pa5dr pa4dr pa3dr pa2dr pa1dr pa0dr initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w table a.55 padr bit functions paior pin function read write 0 general input pin status can write to padr, but this does not affect pin status all other pin status can write to padr, but this does not affect pin status 1 general input padr value value written is output from pin all other padr value can write to padr, but this does not affect pin status
622 a.2.55 port b data register (pbdr) port b ? start address: h'5ffffc2 ? bus width: 8/16/32 register overview: bit: 15 14 13 12 11 10 9 8 bit name: pb15dr pb14dr pb13dr pb12dr pb11dr pb10dr pb9dr pb8dr initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: pb7dr pb6dr pb5dr pb4dr pb3dr pb2dr pb1dr pb0dr initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w table a.56 bit functions pbior pin function read write 0 general input pin status can write to pbdr, but this does not affect pin status tpn pin status cannot write all other pin status can write to pbdr, but this does not affect pin status 1 general input pbdr value value written is output from pin tpn pbdr value cannot write all other pbdr value can write to pbdr, but this does not affect pin status
623 a.2.56 port c data register (pcdr) port c ? start address: h'5ffffd0 ? bus width: 8/16/32 register overview: bit: 15 14 13 12 11 10 9 8 bit name: initial value: r/w: r r r r r r r r bit: 7 6 5 4 3 2 1 0 bit name: pc7dr pc6dr pc5dr pc4dr pc3dr pc2dr pc1dr pc0dr initial value: r/w: r r r r r r r r table a.57 pcdr bit functions pin i/o pin function read write input general input pin status ignored (no affect on pin status) ann 1 ignored (no affect on pin status)
624 a.2.57 port a i/o register (paior) pfc ? start address: h'5ffffc4 ? bus width: 8/16/32 register overview: bit: 15 14 13 12 11 10 9 8 bit name: pa15 ior pa14 ior pa13 ior pa12 ior pa11 ior pa10 ior pa9 ior pa8 ior initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: pa7 ior pa6 ior pa5 ior pa4 ior pa3 ior pa2 ior pa1 ior pa0 ior initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w table a.58 paior bit functions bit bit name value description 15? port a i/o (pa15ior 0 input (initial value) pa0ior) 1 output
625 a.2.58 port b i/o register (pbior) pfc ? start address: h'5ffffc6 ? bus width: 8/16/32 register overview: bit: 15 14 13 12 11 10 9 8 bit name: pb15 ior pb14 ior pb13 ior pb12 ior pb11 ior pb10 ior pb9 ior pb8 ior initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: pb7 ior pb6 ior pb5 ior pb4 ior pb3 ior pb2 ior pb1 ior pb0 ior initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w table a.59 pbior bit functions bit bit name value description 15? port b i/o (pb15ior pb0ior) 0 input (initial value) 1 output
626 a.2.59 port a control register 1 (pacr1) pfc ? start address: h'5ffffc8 ? bus width: 8/16/32 register overview: bit: 15 14 13 12 11 10 9 8 bit name: pa15 md1 pa15 md0 pa14 md1 pa14 md0 pa13 md1 pa13 md0 pa12 md1 pa12 md0 initial value: 0 0 1 1 0 0 1 1 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: pa11 md1 pa11 md0 pa10 md1 pa10 md0 pa9 md1 pa9 md0 pa8 md initial value: 0 0 0 0 0 0 1 0 r/w: r/w r/w r/w r/w r/w r/w r/w
627 table a.60 pacr1 bit functions bit bit name value description 15,14 pa15 mode bits 1,0 0 0 general-purpose input/output (pa15) (initial value) (pa15md1, pa15md0) 0 1 interrupt request input ( irq3 ) 1 0 reserved 1 1 dma transfer request input ( dreq1 ) 13,12 pa14 mode bits 1,0 0 0 general-purpose input/output (pa14) (pa14md1, pa14md0) 0 1 interrupt request input ( irq2 ) 1 0 reserved 1 1 dma transfer request acknowledge output ( dack1 ) (initial value) 11,10 pa13 mode bits 1,0 0 0 general-purpose input/output (pa13) (initial value) (pa13md1, pa13md0) 0 1 interrupt request input (irq1) 1 0 itu timer clock input (tclkb) 1 1 dma transfer request input (dreq0) 9,8 pa12 mode bits 1,0 0 0 general-purpose input/output (pa12) (pa12md1, pa12md0) 0 1 interrupt request input (irq0) 1 0 itu timer clock input (tckla) 1 1 dma transfer request acknowledge output (dack0) (initial value) 7,6 pa11 mode bits 1,0 0 0 general-purpose input/output (pa11) (initial value) (pa11md1, pa11md0) 0 1 high data bus parity input/output (dph) 1 0 itu input capture input/output compare output (tiocb1) 1 1 reserved 5,4 pa10 mode bits 1,0 0 0 general-purpose input/output (pa10) (initial value) (pa10md1, pa10md0) 0 1 low data bus parity input/output (dpl) 1 0 itu input capture input/output compare output (tioca1) 1 1 reserved 3,2 pa9 mode bits 1,0 0 0 general-purpose input/output (pa9) (initial value) (pa9md1, pa9md0) 0 1 address hold output ( ah ) 1 0 a/d conversion trigger input ( adtrg ) 1 1 interrupt request output ( irqout ) 0 pa8 mode bit (pa8md) 0 general-purpose input/output (pa8) (initial value) 1 bus request input ( breq )
628 a.2.60 port a control register 2 (pacr2) pfc ? start address: h'5ffffca ? bus width: 8/16/32 register overview: bit: 15 14 13 12 11 10 9 8 bit name: pa7md pa6md pa5md pa4md initial value: 1 1 1 1 1 1 1 1 r/w: r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: pa3md1 pa3md0 pa2md1 pa2md0 pa1md1 pa1md0 pa0md1 pa0md0 initial value: 1 0 0 1 0 1 0 1 r/w: r/w r/w r/w r/w r/w r/w r/w r/w
629 table a.61 pacr2 bit functions bit bit name value description 14 pa7 mode bit (pa7md) 0 general-purpose input/output (pa7) 1 bus request acknowledge output ( back ) (initial value) 12 pa6 mode bit (pa6md) 0 general-purpose input/output (pa6) 1 read output ( rd ) (initial value) 10 pa5 mode bit (pa5md) 0 general-purpose input/output (pa5) 1 high write output ( wrh ) or low byte strobe output ( lbs ) (initial value) 8 pa4 mode bit (pa4md) 0 general-purpose input/output (pa4) 1 low write output ( wrl ) or write output ( wr )(initial value) 7,6 pa3 mode bits 1,0 0 0 general-purpose input/output (pa3) (pa3md1, pa3md0) 0 1 chip select output ( cs7 ) 1 0 wait state input ( wait ) (initial value) 1 1 reserved 5,4 pa2 mode bits 1,0 0 0 general-purpose input/output (pa2) (pa2md1, pa2md0) 0 1 chip select output ( cs6 ) (initial value) 1 0 itu input capture input/output compare output (tiocb0) 1 1 reserved 3,2 pa1 mode bits 1,0 0 0 general-purpose input/output (pa1) (pa1md1, pa1md0) 0 1 chip select output ( cs5 ) (initial value) 1 0 row address strobe output ( ras ) 1 1 reserved 1,0 pa0 mode bits 1,0 0 0 general-purpose input/output (pa0) (pa0md1, pa0md0) 0 1 chip select output ( cs4 ) (initial value) 1 0 itu input capture input/output compare output (tioca0) 1 1 reserved
630 a.2.61 port b control register 1 (pbcr1) pfc ? start address: h'5ffffcc ? bus width: 8/16/32 register overview: bit: 15 14 13 12 11 10 9 8 bit name: pb15 md1 pb15 md0 pb14 md1 pb14 md0 pb13 md1 pb13 md0 pb12 md1 pb12 md0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: pb11 md1 pb11 md0 pb10 md1 pb10 md0 pb9 md1 pb9 md0 pb8 md1 pb8 md0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w
631 table a.62 pbcr1 bit functions bit bit name value description 15,14 pb15 mode bits 1,0 0 0 general-purpose input/output (pb15) (initial value) (pb15md1, pb15md0) 0 1 interrupt request input ( irq7 ) 1 0 reserved 1 1 timing pattern output (tp15) 13,12 pb14 mode bits 1,0 0 0 general-purpose input/output (pb14) (initial value) (pb14md1, pb14md0) 0 1 interrupt request input ( irq6 ) 1 0 reserved 1 1 timing pattern output (tp14) 11,10 pb13 mode bits 1,0 0 0 general-purpose input/output (pb13) (initial value) (pb13md1, pb13md0) 0 1 interrupt request input ( irq5 ) 1 0 serial clock input/output (sck1) 1 1 timing pattern output (tp13) 9,8 pb12 mode bits 1,0 0 0 general-purpose input/output (pb12) (initial value) (pb12md1, pb12md0) 0 1 interrupt request input ( irq4 ) 1 0 serial clock input/output (sck0) 1 1 timing pattern output (tp12) 7,6 pb11 mode bits 1,0 0 0 general-purpose input/output (pb11) (initial value) (pb11md1, pb11md0) 0 1 reserved 1 0 transmit data input (txd1) 1 1 timing pattern output (tp11) 5,4 pb10 mode bits 1,0 0 0 general-purpose input/output (pb10) (initial value) (pb10md1, pb10md0) 0 1 reserved 1 0 receive data input (rxd1) 1 1 timing pattern output (tp10) 3,2 pb9 mode bits 1,0 0 0 general-purpose input/output (pb9) (initial value) (pb9md1, pb9md0) 0 1 reserved 1 0 transmit data input (txd0) 1 1 timing pattern output (tp9) 1,0 pb8 mode bits 1,0 0 0 general-purpose input/output (pb8) (initial value) (pb8md1, pb8md0) 0 1 reserved 1 0 receive data input (rxd0) 1 1 timing pattern output (tp8)
632 a.2.62 port b control register 2 (pbcr2) pfc ? start address: h'5ffffce ? bus width: 8/16/32 register overview: bit: 15 14 13 12 11 10 9 8 bit name: pb7md1 pb7md0 pb6md1 pb6md0 pb5md1 pb5md0 pb4md1 pb4md0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: pb3md1 pb3md0 pb2md1 pb2md0 pb1md1 pb1md0 pb0md1 pb0md0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w
633 table a.63 pbcr2 bit functions bit bit name value description 15,14 pb7 mode bits 1,0 0 0 general-purpose input/output (pb7) (initial value) (pb7md1, pb7md0) 0 1 itu timer clock input (tclkd) 1 0 itu output compare output (tocxb4) 1 1 timing pattern output (tp7) 13,12 pb6 mode bits 1,0 0 0 general-purpose input/output (pb6) (initial value) (pb6md1, pb6md0) 0 1 itu timer clock input (tclkc) 1 0 itu output compare output (tocxa4) 1 1 timing pattern output (tp6) 11,10 pb5 mode bits 1,0 0 0 general-purpose input/output (pb5) (initial value) (pb5md1, pb5md0) 0 1 reserved 1 0 itu input capture input/output compare output (tiocb4) 1 1 timing pattern output (tp5) 9,8 pb4 mode bits 1,0 0 0 general-purpose input/output (pb4) (initial value) (pb4md1, pb4md0) 0 1 reserved 1 0 itu input capture input/output compare output (tioca4) 1 1 timing pattern output (tp4) 7,6 pb3 mode bits 1,0 0 0 general-purpose input/output (pb3) (initial value) (pb3md1, pb3md0) 0 1 reserved 1 0 itu input capture input/output compare output (tiocb3) 1 1 timing pattern output (tp3) 5,4 pb2 mode bits 1,0 0 0 general-purpose input/output (pb2) (initial value) (pb2md1, pb2md0) 0 1 reserved 1 0 itu input capture input/output compare output (tioca3) 1 1 timing pattern output (tp2) 3,2 pb1 mode bits 1,0 0 0 general-purpose input/output (pb1) (initial value) (pb1md1, pb1md0) 0 1 reserved 1 0 itu input capture input/output compare output (tiocb2) 1 1 timing pattern output (tp1) 1,0 pb0 mode bits 1,0 0 0 general-purpose input/output (pb0) (initial value) (pb0md1, pb0md0) 0 1 reserved 1 0 itu input capture input/output compare output (tioca2) 1 1 timing pattern output (tp0)
634 a.2.63 column address strobe pin control register (cascr) pfc ? start address: h'5ffffee ? bus width: 8/16/32 register overview: bit: 15 14 13 12 11 10 9 8 bit name: cash md1 cash md0 casl md1 casl md0 initial value: 0 1 0 1 1 1 1 1 r/w: r/w r/w r/w r/w bit: 7 6 5 4 3 2 1 0 bit name: initial value: 1 1 1 1 1 1 1 1 r/w: table a.64 cascr bit functions bit bit name value description 15,14 cash mode bits 1,0 0 0 reserved (cashmd1, cashmd0) 0 1 chip select output ( cs1 ) (initial value) 1 0 column address strobe output ( cash ) 1 1 reserved 13,12 casl mode bits 1,0 0 0 reserved (caslmd1, caslmd0) 0 1 chip select output ( cs3 ) (initial value) 1 0 column address strobe output ( casl ) 1 1 reserved
635 a.2.64 tpc output mode register (tpmr) tpc ? start address: h'5fffff0 ? bus width: 8/16 register overview: bit: 7 6 5 4 3 2 1 0 bit name: g3nov g2nov g1nov g0nov initial value: 1 1 1 1 0 0 0 0 r/w: r/w r/w r/w r/w table a.65 tpmr bit functions bit bit name value description 3 group 3 non- overlap (g3nov) 0 tpc output group 3 operates normally (the output value is updated at every compare match a of the selected itu) (initial value) 1 tpc output group 3 operates in non-overlap mode (1 output and 0 output can be performed independently upon compare matches a and b of the selected itu) 2 group 2 non- overlap (g2nov) 0 tpc output group 2 operates normally (the output value is updated at every compare match a of the selected itu) (initial value) 1 tpc output group 2 operates in non-overlap mode (1 output and 0 output can be performed independently upon compare matches a and b of the selected itu) 1 group 1 non- overlap (g1nov) 0 tpc output group 1 operates normally (the output value is updated at every compare match a of the selected itu) (initial value) 1 tpc output group 1 operates in non-overlap mode (1 output and 0 output can be performed independently upon compare matches a and b of the selected itu) 0 group 0 non- overlap (g0nov) 0 tpc output group 0 operates normally (the output value is updated at every compare match a of the selected itu) (initial value) 1 tpc output group 0 operates in non-overlap mode (1 output and 0 output can be performed independently upon compare matches a and b of the selected itu)
636 a.2.65 tpc output control register (tpcr) tpc ? start address: h'5fffff1 ? bus width: 8/16 register overview: bit: 7 6 5 4 3 2 1 0 bit name: g3cms1 g3cms0 g2cms1 g2cms0 g1cms1 g1cms0 g0cms1 g0cms0 initial value: 1 1 1 1 1 1 1 1 r/w: r/w r/w r/w r/w r/w r/w r/w r/w
637 table a.66 tpcr bit functions bit bit name value description 7,6 group 3 compare match sel- ect 1, 0 (g3cms1, g3cms0) 0 0 the output trigger of tpc output group 3 (pins tp15 tp12) is the itu channel 0 compare match 0 1 the output trigger of tpc output group 3 (pins tp15 tp12) is the itu channel 1 compare match 1 0 the output trigger of tpc output group 3 (pins tp15 tp12) is the itu channel 2 compare match 1 1 the output trigger of tpc output group 3 (pins tp15 tp12) is the itu channel 3 compare match * 5,4 group 2 compare match sel- ect 1, 0 (g2cms1, g2cms0) 0 0 the output trigger of tpc output group 2 (pins tp11 tp8) is the itu channel 0 compare match 0 1 the output trigger of tpc output group 2 (pins tp11 tp8) is the itu channel 1 compare match 1 0 the output trigger of tpc output group 2 (pins tp11 tp8) is the itu channel 2 compare match 1 1 the output trigger of tpc output group 2 (pins tp11 tp8) is the itu channel 3 compare match * 3,2 group 1 compare match sel- ect 1, 0 (g1cms1, g1cms0) 0 0 the output trigger of tpc output group 1 (pins tp7 tp4) is the itu channel 0 compare match 0 1 the output trigger of tpc output group 1 (pins tp7 tp4) is the itu channel 1 compare match 1 0 the output trigger of tpc output group 1 (pins tp7 tp4) is the itu channel 2 compare match 1 1 the output trigger of tpc output group 1 (pins tp7 tp4) is the itu channel 3 compare match * 1,0 group 0 compare match sel- ect 1, 0 (g0cms1, g0cms0) 0 0 the output trigger of tpc output group 0 (pins tp3 tp0) is the itu channel 0 compare match 0 1 the output trigger of tpc output group 0 (pins tp3 tp0) is the itu channel 1 compare match 1 0 the output trigger of tpc output group 0 (pins tp3 tp0) is the itu channel 2 compare match 1 1 the output trigger of tpc output group 0 (pins tp3 tp0) is the itu channel 3 compare match * note: * initial value
638 a.2.66 next data enable register a (ndera) tpc ? start address: h'5fffff3 ? bus width: 8/16 register overview: bit: 7 6 5 4 3 2 1 0 bit name: nder7 nder6 nder5 nder4 nder3 nder2 nder1 nder0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w table a.67 ndera bit functions bit bit name value description 7? next data enable 7? (nder7?der0) 0 disable tpc output tp7?p0 disabled (initial value) (transfer from ndr7?dr0 to pb7?b0 disabled) 1 tpc output tp7?p0 enabled (transfer from ndr7?dr0 to pb7?b0 enabled) a.2.67 next data enable register b (nderb) tpc ? start address: h'5fffff2 ? bus width: 8/16 register overview: bit: 7 6 5 4 3 2 1 0 bit name: nder15 nder14 nder13 nder12 nder11 nder10 nder9 nder8 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w table a.68 nderb bit functions bit bit name value description 7? next data enable 7? (nder15?der8) 0 tpc output tp15?p8 disabled (initial value) (transfer from ndr15?dr8 to pb15?b8 disabled) 1 tpc output tp15?p8 enabled (transfer from ndr15?dr8 to pb15?b8 enabled)
639 a.2.68 next data register a (ndra) tpc (when the output triggers of tpc output groups 0 and 1 are the same) ? start address: h'5fffff5 ? bus width: 8/16 register overview: bit: 7 6 5 4 3 2 1 0 bit name: ndr7 ndr6 ndr5 ndr4 ndr3 ndr2 ndr1 ndr0 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w table a.69 ndra bit functions bit bit name description 7? next data 7? (ndr7 ndr4) stores the next output data for tpc output group 1 3? next data 3? (ndr3 ndr0) stores the next output data for tpc output group 0 a.2.69 next data register a (ndra) tpc (when the output triggers of tpc output groups 0 and 1 are the same) ? start address: h'5fffff7 ? bus width: 8/16 register overview: bit: 7 6 5 4 3 2 1 0 bit name: initial value: 1 1 1 1 1 1 1 1 r/w: table a.70 ndra bit functions bit bit name description 7? reserved bits writing is invalid; always read as 1
640 a.2.70 next data register a (ndra) tpc (when the output triggers of tpc output groups 0 and 1 are different) ? start address: h'5fffff5 ? bus width: 8/16 register overview: bit: 7 6 5 4 3 2 1 0 bit name: ndr7 ndr6 ndr5 ndr4 initial value: 0 0 0 0 1 1 1 1 r/w: r/w r/w r/w r/w table a.71 ndra bit functions bit bit name description 7? next data 7? (ndr7 ndr4) stores the next output data for tpc output group 1 a.2.71 next data register a (ndra) tpc (when the output triggers of tpc output groups 0 and 1 are different) ? start address: h'5fffff7 ? bus width: 8/16 register overview: bit: 7 6 5 4 3 2 1 0 bit name: ndr3 ndr2 ndr1 ndr0 initial value: 1 1 1 1 0 0 0 0 r/w: r/w r/w r/w r/w table a.72 ndra bit functions bit bit name description 3? next data 3? (ndr3 ndr0) stores the next output data for tpc output group 0
641 a.2.72 next data register b (ndrb) tpc (when the output triggers of tpc output groups 2 and 3 are the same) ? start address: h'5fffff4 ? bus width: 8/16 register overview: bit: 7 6 5 4 3 2 1 0 bit name: ndr15 ndr14 ndr13 ndr12 ndr11 ndr10 ndr9 ndr8 initial value: 0 0 0 0 0 0 0 0 r/w: r/w r/w r/w r/w r/w r/w r/w r/w table a.73 ndrb bit functions bit bit name description 7? next data 15?2 (ndr15 ndr12) stores the next output data for tpc output group 3 3? next data 11? (ndr11 ndr8) stores the next output data for tpc output group 2 a.2.73 next data register b (ndrb) tpc (when the output triggers of tpc output groups 2 and 3 are the same) ? start address: h'5fffff6 ? bus width: 8/16 ? module: tpc register overview: bit: 7 6 5 4 3 2 1 0 bit name: initial value: 1 1 1 1 1 1 1 1 r/w: table a.74 ndrb bit functions bit bit name description 7? reserved bits writing is invalid; always read as 1
642 a.2.74 next data register b (ndrb) tpc (when the output triggers of tpc output groups 2 and 3 are different) ? start address: h'5fffff4 ? bus width: 8/16 register overview: bit: 7 6 5 4 3 2 1 0 bit name: ndr15 ndr14 ndr13 ndr12 initial value: 0 0 0 0 1 1 1 1 r/w: r/w r/w r/w r/w table a.75 ndrb bit functions bit bit name description 7? next data 15?2 (ndr15 ndr12) stores the next output data for tpc output group 3 a.2.75 next data register b (ndrb) tpc (when the output triggers of tpc output groups 2 and 3 are different) ? start address: h'5fffff6 ? bus width: 8/16 register overview: bit: 7 6 5 4 3 2 1 0 bit name: ndr11 ndr10 ndr9 ndr8 initial value: 1 1 1 1 0 0 0 0 r/w: r/w r/w r/w r/w table a.76 ndrb bit functions bit bit name description 3? next data 11? (ndr11 ndr8) stores the next output data for tpc output group 2
643 a.3 register status in reset and power-down states table a.77 register status in reset and power-down states reset state power-down state category abbreviation power on manual standby sleep cpu r0?15 initialized initialized held held sr gbr vbr mach,macl pr pc interrupt controller (intc) ipra?pre initialized initialized held held icr user break controller (ubc) barh,barl initialized initialized held held bamrh,bamrl bbr bus state controller (bsc) bcr initialized held held held wcr1?cr3 dcr rcr rtscr rtcnt rtcor pcr direct memory access sar0?ar3 initialized initialized initialized held controller (dmac) dar0?ar3 tcr0?cr3 chcr0?hcr3 dmaor
644 table a.77 register status in reset and power-down states (cont) reset state power-down state category abbreviation power on manual standby sleep 16-bit integrated timer pulse tstr initialized initialized initialized held unit (itu) tsnc tmda, tmdb tcnt0?cnt4 gra0?ra4, grb0?rb4 bra3, bra4. brb3, brb4 tcr0?cr4 tior0?ior4 tier0?ier4 tsr0?sr4 programmable timing tpmr initialized initialized held held pattern controller (tpc) tpcr ndera,nderb ndra, ndrb watchdog timer (wdt) tcnt initialized initialized held held tcsr * 1 rstcr * 2 initialized serial communication smr initialized initialized initialized held interface (sci) brr scr tdr tsr held ssr initialized rdr rsr held notes: * 1 bits 7? (ovf, wt/it, tme) are initialized, bits 2? (cks2?ks0) are held. * 2 not initialized in the case of a reset by the wdt.
645 table a.78 register status in reset and power-down states (cont) reset state power-down state category abbreviation power on manual standby sleep a/d converter addra addrd initialized initialized initialized held adcsr adcr pin function controller paior,pbior initialized held held held (pfc) pacr1,pacr2, pbcr1,pbcr2 cascr parallel i/o ports (i/o) padr,pbdr initialized held held held pcdr * 3 * 3 * 3 * 3 power-down-state related sbycr initialized initialized held held note: * 3 bits 15? are always undetermined, bits 7? always reflect the state of the corresponding pin.
646 appendix b pin states table b.1 pin state in resets, power-down state, and bus-released state pin state reset power-down bus category pin power-on manual standby sleep released clock ck o o h * 1 oo system control res iiiii wdtovf hhh * 1 oo breq ?zii back zozol interrupt nmi i i i i i irq7 ? rq0 ?zii irqout ?o * 1 ho address bus a21?0 h o z h z data bus ad15?d0 z z z z z dph,dpl z z z z bus control wait ii * 2 zi * 2 i * 2 cs7 ?zhz cs6 cs0 zozhz rd hozhz wrh ( lbs ), wrl ( wr ) hozhz ras ?o * 1 oz cash , casl ?ooz ah ?zhz direct memory access dreq0 , dreq1 ?zii controller (dmac) dack0,dack1 z o k * 1 oo 16-bit integrated timer tioca0?ioca4 i k * 1 i/o i/o pulse unit (itu) tiocb0?iocb4 i k * 1 i/o i/o tocxa4, tocxb4 ?k * 1 oo tclka?clkd i z i i timing pattern controller (tpc) tp15?p0 i k * 1 oo
647 table b.1 pin state in resets, power-down state, and bus-released state (cont) pin state reset power-down bus category pin power-on manual standby sleep released serial communication txd0?xd1 z k * 1 oo interface (sci) rxd0,rxd1 i z i i sck0,sck1 i z i/o i/o a/d converter an7?n0 z z z i i adtrg ?zii i/o ports pa14, pa12, pa7?a0 i/o k * 1 i/o i/o pa15, pa13, pa11?a8, pb15?b0 z i/o k * 1 i/o i/o pc7?c0 z i z i i ? one of the multiplexed pin functions is allocated, but the pin functions in the reset state are different. i: input o: output h: high l: low z: high impedance k: input pins are high-impedance, output pins hold their state. notes: * 1 when the port high impedance bit (hiz) in the standby control register (sbycr) is set to 1, the output pins become high-impedance. * 2 when the pin pull-up control bit (wpu) in the wait state control register (wcr3) is set to 1, the wait pin is pulled up, but if set to 0, it is not pulled up.
648 the following table shows the states of bus control pins and external bus pins in accesses of various address spaces. table b.2 pin states in address space accesses on-chip peripheral modules 16-bit space pin name on-chip rom space on-chip ram space 8-bit space upper byte lower byte word cs7 cs0 high high high high high high ras high high high high high high cash high high high high high high casl high high high high high high ah low low low low low low rd r high high high high high high w high high high high high wrh / lbs r high high high high high high w high high high high high wrl / wr r high high high high high high w high high high high high a0/ hbs a0 a0 a0 a0 a0 a0 a21?1 address address address address address address ad15?d8 high-z high-z high-z high-z high-z high-z ad7?d0 high-z high-z high-z high-z high-z high-z dph high-z high-z high-z high-z high-z high-z dpl high-z high-z high-z high-z high-z high-z r: read w: write
649 table b.2 pin states in address space accesses (cont) address/data multiplex i/o space 16-bit space wrh, wrl, a0 system wr, hbs, lbs system pin name 8-bit space upper byte lower byte word upper byte lower byte word cs7, cs5 cs0 high high high high high high high cs6 low low low low low low low ras high high high high high high high cash high high high high high high high casl high high high high high high high ah ah ah ah ah ah ah ah rd r low low low low low low low w high high high high high high high wrh / lbs r * high high high high low low w * low high low high low low wrl / wr r high high high high high high high w low high low low low low low a0/ hbs a0 low high low low high low a21?1 address address address address address address address ad15?d8 high-z address/ data address address/ data address/ data address address/ data ad7?d0 address/ data address address/ data address/ data address address/ data address/ data r: read w: write ah : when addresses are output from ad15?d0, an address hold signal is output. note: * cannot be used; available only for 16-bit space access.
650 table b.2 pin states in address space accesses (cont) dram space 16-bit space 2-cas system 2-we system pin name 8-bit space upper byte lower byte word upper byte lower byte word cs7 cs2 , cs0 high high high high high high high cs1 low low low low ras ras ras ras ras ras ras ras cash high cash high cash high high high casl cas high casl casl casl casl casl ah low low low low low low low rd r low low low low low low low w high high high high high high high wrh r high high high high high high high w high high high high low high low wrl r high high high high high high high w low low low low high low low a0 a0 a0 a0 a0 a0 a0 a0 a21?1 address address address address address address address ad15?d8 high-z data high-z data data high-z data ad7?d0 data high-z data data high-z data data dph high-z parity high-z parity parity high-z parity dpl parity high-z parity parity high-z parity parity r: read w: write ? the cs1 pin is used as the cash signal output pin. ras : when a row address is output from a21?0, an address strobe signal is output. cas : when a column address is output from a21?0, an address strobe signal is output. cash : when a column address is output from a21?0 during an upper byte access, an address strobe signal is output. casl : when a column address is output from a21?0 during a lower byte access, an address strobe signal is output. parity: when a dram space parity check is selected with the parity check enable bits (pchk1,pchk0) in the parity control register (pcr), this pin is used as the parity pin.
651 table b.2 pin states in address space accesses (cont) external memory space 16-bit space wrh, wrl, a0 system wr, hbs, lbs system pin name 8-bit space upper byte lower byte word upper byte lower byte word cs7 cs0 valid valid valid valid valid valid valid ras high high high high high high high cash high high high high high high high casl high high high high high high high ah low low low low low low low rd r low low low low low low low w high high high high high high high wrh / lbs r * high high high high low low w * low high low high low low wrl / wr r high high high high high high high w low high low low low low low a0/ hbs a0 a0 a0 a0 low high low a21?1 address address address address address address address ad15?d8 high-z data high-z data data high-z data ad7?d0 data high-z data data high-z data data dph high-z parity high-z parity parity high-z parity dpl parity high-z parity parity high-z parity parity r: read w: write valid: chip select signal for the area accessed is low; other chip select signals are high. parity: when an area 2 parity check is selected with the parity check enable bits (pchk1, pchk0) in the parity control register (pcr), this pin is used as the parity pin. note: * cannot be used; available only for 16-bit space access.
652 appendix c package dimensions figure c.1 and figure c.2 show the package dimensions of the sh microcomputer. hitachi code jedec jeita mass (reference value) fp-112 conforms 2.4 g * dimension including the plating thickness base material dimension 0.10 23.2 0.3 * 0.32 0.08 0.65 1.6 0.8 0.3 * 0.17 0.05 3.05 max 23.2 0.3 84 57 56 29 112 1 28 20 85 2.70 0 8 0.13 m 0.10 + 0.15 ? 0.10 1.23 0.30 0.06 0.15 0.04 unit: mm figure c.1 package dimensions (fp-112)
653 hitachi code jedec jeita mass (reference value) tfp-120 conforms 0.5 g * dimension including the plating thickness base material dimension 16.0 0.2 14 0.07 0.10 0.5 0.1 16.0 0.2 0.4 0.10 0.10 1.20 max * 0.17 0.05 0 8 90 61 130 91 120 31 60 m * 0.17 0.05 1.0 1.00 1.2 0.15 0.04 0.15 0.04 unit: mm figure c.2 package dimensions (tfp-120)
654
sh7032 and sh7034 hardware manual publication date: 1st edition, september 1994 6th edition, september 2002 published by: business operation division semiconductor & integrated circuits hitachi, ltd. edited by: technical documentation group hitachi kodaira semiconductor co., ltd. co py ri g ht ? hitachi, ltd., 1994. all ri g hts reserved. printed in ja p an.


▲Up To Search▲   

 
Price & Availability of HD6437034

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X